forked from mystiq/hydrogen-web
send unsent messages after first sync
This commit is contained in:
parent
707988f806
commit
851100b88a
3 changed files with 11 additions and 0 deletions
|
@ -76,6 +76,7 @@ export default async function main(container) {
|
||||||
if (needsInitialSync) {
|
if (needsInitialSync) {
|
||||||
showSession(container, session, sync);
|
showSession(container, session, sync);
|
||||||
}
|
}
|
||||||
|
session.notifyNetworkAvailable();
|
||||||
} catch(err) {
|
} catch(err) {
|
||||||
console.error(`${err.message}:\n${err.stack}`);
|
console.error(`${err.message}:\n${err.stack}`);
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,6 +42,10 @@ export default class Room extends EventEmitter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resumeSending() {
|
||||||
|
this._sendQueue.resumeSending();
|
||||||
|
}
|
||||||
|
|
||||||
load(summary, txn) {
|
load(summary, txn) {
|
||||||
this._summary.load(summary);
|
this._summary.load(summary);
|
||||||
return this._syncWriter.load(txn);
|
return this._syncWriter.load(txn);
|
||||||
|
|
|
@ -38,6 +38,12 @@ export default class Session {
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
notifyNetworkAvailable() {
|
||||||
|
for (const room of this._rooms) {
|
||||||
|
room.resumeSending();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async _getPendingEventsByRoom(txn) {
|
async _getPendingEventsByRoom(txn) {
|
||||||
const pendingEvents = await txn.pendingEvents.getAll();
|
const pendingEvents = await txn.pendingEvents.getAll();
|
||||||
return pendingEvents.reduce((groups, pe) => {
|
return pendingEvents.reduce((groups, pe) => {
|
||||||
|
|
Loading…
Reference in a new issue