only prompt after waiting 10s for sync UTD

This commit is contained in:
Bruno Windels 2020-09-22 09:30:25 +02:00
parent 0a83bf1176
commit 6cd227b82d

View file

@ -159,10 +159,6 @@ export class RoomEncryption {
}
async _requestMissingSessionFromBackup(senderKey, sessionId, source) {
if (!this._sessionBackup) {
this._notifyMissingMegolmSession();
return;
}
// if the message came from sync, wait 10s to see if the room key arrives,
// and only after that proceed to request from backup
if (source === DecryptionSource.Sync) {
@ -171,6 +167,11 @@ export class RoomEncryption {
return;
}
}
// show prompt to enable secret storage
if (!this._sessionBackup) {
this._notifyMissingMegolmSession();
return;
}
try {
const session = await this._sessionBackup.getSession(this._room.id, sessionId);