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 store = txn.objectStore("users");
|
||||
return selectQuery(store, undefined, (cursor) => {
|
||||
const user = new User(cursor.value.userId);
|
||||
Object.assign(user, cursor.value);
|
||||
return user;
|
||||
if (typeof User.deserialize === "function") {
|
||||
return User.deserialize(cursor.value);
|
||||
} else {
|
||||
const user = new User(cursor.value.userId);
|
||||
Object.assign(user, cursor.value);
|
||||
return user;
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
|
Reference in New Issue
Block a user