mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 11:35:04 +01:00
also look for remote echos based on event_id
This commit is contained in:
parent
f02641c808
commit
8354c58c07
@ -64,13 +64,16 @@ export default class SendQueue {
|
|||||||
const removed = [];
|
const removed = [];
|
||||||
for (const event of events) {
|
for (const event of events) {
|
||||||
const txnId = event.unsigned && event.unsigned.transaction_id;
|
const txnId = event.unsigned && event.unsigned.transaction_id;
|
||||||
|
let idx;
|
||||||
if (txnId) {
|
if (txnId) {
|
||||||
const idx = this._pendingEvents.array.findIndex(pe => pe.txnId === txnId);
|
idx = this._pendingEvents.array.findIndex(pe => pe.txnId === txnId);
|
||||||
if (idx !== -1) {
|
} else {
|
||||||
const pendingEvent = this._pendingEvents.get(idx);
|
idx = this._pendingEvents.array.findIndex(pe => pe.remoteId === event.event_id);
|
||||||
txn.pendingEvents.remove(pendingEvent.roomId, pendingEvent.queueIndex);
|
}
|
||||||
removed.push(pendingEvent);
|
if (idx !== -1) {
|
||||||
}
|
const pendingEvent = this._pendingEvents.get(idx);
|
||||||
|
txn.pendingEvents.remove(pendingEvent.roomId, pendingEvent.queueIndex);
|
||||||
|
removed.push(pendingEvent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return removed;
|
return removed;
|
||||||
|
Loading…
Reference in New Issue
Block a user