mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 19:45:05 +01:00
Allow simultaneous adds
This commit is contained in:
parent
1b6fea6e4d
commit
021844bf0a
@ -300,9 +300,7 @@ export class BaseRoom extends EventEmitter {
|
||||
await decryptRequest.complete();
|
||||
}
|
||||
// once txn is committed, update in-memory state & emit events
|
||||
for (const fragment of gapResult.fragments) {
|
||||
this._fragmentIdComparer.add(fragment);
|
||||
}
|
||||
this._fragmentIdComparer.add(...gapResult.fragments);
|
||||
if (extraGapFillChanges) {
|
||||
this._applyGapFill(extraGapFillChanges);
|
||||
}
|
||||
|
@ -171,9 +171,11 @@ export class FragmentIdComparer {
|
||||
}
|
||||
|
||||
/** use for fragments coming out of persistence, not newly created ones, or also fragments for a new island (like for a permalink) */
|
||||
add(fragment) {
|
||||
const copy = new Fragment(fragment.id, fragment.previousId, fragment.nextId);
|
||||
this._fragmentsById.set(fragment.id, copy);
|
||||
add(...fragments) {
|
||||
for (const fragment of fragments) {
|
||||
const copy = new Fragment(fragment.id, fragment.previousId, fragment.nextId);
|
||||
this._fragmentsById.set(fragment.id, copy);
|
||||
}
|
||||
this.rebuild(this._fragmentsById.values());
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user