You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-08-09 10:22:46 +03:00
Check for a deserialize() function
This commit is contained in:
@@ -122,9 +122,13 @@ IndexedDBStoreBackend.prototype = {
|
|||||||
const txn = this.db.transaction(["users"], "readonly");
|
const txn = this.db.transaction(["users"], "readonly");
|
||||||
const store = txn.objectStore("users");
|
const store = txn.objectStore("users");
|
||||||
return selectQuery(store, undefined, (cursor) => {
|
return selectQuery(store, undefined, (cursor) => {
|
||||||
const user = new User(cursor.value.userId);
|
if (typeof User.deserialize === "function") {
|
||||||
Object.assign(user, cursor.value);
|
return User.deserialize(cursor.value);
|
||||||
return user;
|
} else {
|
||||||
|
const user = new User(cursor.value.userId);
|
||||||
|
Object.assign(user, cursor.value);
|
||||||
|
return user;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user