mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
only increment sent counter after successful send
otherwise the message doesn't get sent after coming back online
This commit is contained in:
parent
b65da9b8a9
commit
24cb9e3f5c
@ -31,7 +31,6 @@ export class SendQueue {
|
|||||||
while (this._amountSent < this._pendingEvents.length) {
|
while (this._amountSent < this._pendingEvents.length) {
|
||||||
const pendingEvent = this._pendingEvents.get(this._amountSent);
|
const pendingEvent = this._pendingEvents.get(this._amountSent);
|
||||||
console.log("trying to send", pendingEvent.content.body);
|
console.log("trying to send", pendingEvent.content.body);
|
||||||
this._amountSent += 1;
|
|
||||||
if (pendingEvent.remoteId) {
|
if (pendingEvent.remoteId) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -50,6 +49,7 @@ export class SendQueue {
|
|||||||
console.log("writing remoteId now");
|
console.log("writing remoteId now");
|
||||||
await this._tryUpdateEvent(pendingEvent);
|
await this._tryUpdateEvent(pendingEvent);
|
||||||
console.log("keep sending?", this._amountSent, "<", this._pendingEvents.length);
|
console.log("keep sending?", this._amountSent, "<", this._pendingEvents.length);
|
||||||
|
this._amountSent += 1;
|
||||||
}
|
}
|
||||||
} catch(err) {
|
} catch(err) {
|
||||||
if (err instanceof ConnectionError) {
|
if (err instanceof ConnectionError) {
|
||||||
|
Loading…
Reference in New Issue
Block a user