mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2025-01-08 19:35:43 +01:00
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
@ -116,13 +116,12 @@ export class DeviceTracker {
|
|||||||
if (room.isTrackingMembers || !room.isEncrypted) {
|
if (room.isTrackingMembers || !room.isEncrypted) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
const memberList = await room.loadMemberList(undefined, log);
|
||||||
const txn = await this._storage.readWriteTxn([
|
const txn = await this._storage.readWriteTxn([
|
||||||
this._storage.storeNames.roomSummary,
|
this._storage.storeNames.roomSummary,
|
||||||
this._storage.storeNames.userIdentities,
|
this._storage.storeNames.userIdentities,
|
||||||
]);
|
]);
|
||||||
let memberList;
|
|
||||||
try {
|
try {
|
||||||
memberList = await room.loadMemberList(txn, log);
|
|
||||||
let isTrackingChanges;
|
let isTrackingChanges;
|
||||||
try {
|
try {
|
||||||
isTrackingChanges = room.writeIsTrackingMembers(true, txn);
|
isTrackingChanges = room.writeIsTrackingMembers(true, txn);
|
||||||
@ -140,7 +139,7 @@ export class DeviceTracker {
|
|||||||
await txn.complete();
|
await txn.complete();
|
||||||
room.applyIsTrackingMembersChanges(isTrackingChanges);
|
room.applyIsTrackingMembersChanges(isTrackingChanges);
|
||||||
} finally {
|
} finally {
|
||||||
memberList?.release();
|
memberList.release();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user