Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Test workaround for element-hq/element-web#27165
Browse files Browse the repository at this point in the history
  • Loading branch information
richvdh committed May 22, 2024
1 parent a29cabe commit ab0f795
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/DeviceListener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ export default class DeviceListener {
private dispatcherRef?: string;
// device IDs for which the user has dismissed the verify toast ('Later')
private dismissed = new Set<string>();
/** Have we shown the user an encryption setup toast? */
private shownThisDeviceToast = false;
// has the user dismissed any of the various nag toasts to setup encryption on this device?
private dismissedThisDeviceToast = false;
/** Cache of the info about the current key backup on the server. */
Expand Down Expand Up @@ -134,6 +136,7 @@ export default class DeviceListener {
this.dispatcherRef = undefined;
}
this.dismissed.clear();
this.shownThisDeviceToast = false;
this.dismissedThisDeviceToast = false;
this.keyBackupInfo = null;
this.keyBackupFetchedAt = null;
Expand Down Expand Up @@ -313,7 +316,7 @@ export default class DeviceListener {
hideSetupEncryptionToast();

this.checkKeyBackupStatus();
} else if (this.shouldShowSetupEncryptionToast()) {
} else if (this.shouldShowSetupEncryptionToast() && !this.shownThisDeviceToast) {
// make sure our keys are finished downloading
await crypto.getUserDeviceInfo([cli.getSafeUserId()]);

Expand Down Expand Up @@ -341,6 +344,7 @@ export default class DeviceListener {
}
}
}
this.shownThisDeviceToast = true;
}

// This needs to be done after awaiting on getUserDeviceInfo() above, so
Expand Down

0 comments on commit ab0f795

Please sign in to comment.