forked from mystiq/hydrogen-web
let loadMembers use own txn in case members haven't been fetched yet
if they haven't, it will need a network request, meaning that the txn will get closed, so we can't reuse it afterwards
This commit is contained in:
parent
50b6ee91d7
commit
f18520a2fe
1 changed files with 2 additions and 3 deletions
|
@ -116,13 +116,12 @@ export class DeviceTracker {
|
|||
if (room.isTrackingMembers || !room.isEncrypted) {
|
||||
return;
|
||||
}
|
||||
const memberList = await room.loadMemberList(undefined, log);
|
||||
const txn = await this._storage.readWriteTxn([
|
||||
this._storage.storeNames.roomSummary,
|
||||
this._storage.storeNames.userIdentities,
|
||||
]);
|
||||
let memberList;
|
||||
try {
|
||||
memberList = await room.loadMemberList(txn, log);
|
||||
let isTrackingChanges;
|
||||
try {
|
||||
isTrackingChanges = room.writeIsTrackingMembers(true, txn);
|
||||
|
@ -140,7 +139,7 @@ export class DeviceTracker {
|
|||
await txn.complete();
|
||||
room.applyIsTrackingMembersChanges(isTrackingChanges);
|
||||
} finally {
|
||||
memberList?.release();
|
||||
memberList.release();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue