mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2025-01-11 04:27:40 +01:00
this should be filter rather than find, we iterate it
This commit is contained in:
parent
f271517446
commit
619cf9bcbb
@ -104,7 +104,7 @@ export class SendQueue {
|
|||||||
// the relatedTxnId to a related event id, they need to do so now.
|
// the relatedTxnId to a related event id, they need to do so now.
|
||||||
// We ensure this by writing the new remote id for the pending event and all related events
|
// We ensure this by writing the new remote id for the pending event and all related events
|
||||||
// with unresolved relatedTxnId in the queue in one transaction.
|
// with unresolved relatedTxnId in the queue in one transaction.
|
||||||
const relatedEvents = this._pendingEvents.array.find(pe => pe.relatedTxnId === pendingEvent.txnId);
|
const relatedEvents = this._pendingEvents.array.filter(pe => pe.relatedTxnId === pendingEvent.txnId);
|
||||||
const txn = await this._storage.readWriteTxn([this._storage.storeNames.pendingEvents]);
|
const txn = await this._storage.readWriteTxn([this._storage.storeNames.pendingEvents]);
|
||||||
try {
|
try {
|
||||||
await this._tryUpdateEventWithTxn(pendingEvent, txn);
|
await this._tryUpdateEventWithTxn(pendingEvent, txn);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user