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

Commit ab0f795

Browse files
committed
Test workaround for element-hq/element-web#27165
1 parent a29cabe commit ab0f795

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/DeviceListener.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ export default class DeviceListener {
6262
private dispatcherRef?: string;
6363
// device IDs for which the user has dismissed the verify toast ('Later')
6464
private dismissed = new Set<string>();
65+
/** Have we shown the user an encryption setup toast? */
66+
private shownThisDeviceToast = false;
6567
// has the user dismissed any of the various nag toasts to setup encryption on this device?
6668
private dismissedThisDeviceToast = false;
6769
/** Cache of the info about the current key backup on the server. */
@@ -134,6 +136,7 @@ export default class DeviceListener {
134136
this.dispatcherRef = undefined;
135137
}
136138
this.dismissed.clear();
139+
this.shownThisDeviceToast = false;
137140
this.dismissedThisDeviceToast = false;
138141
this.keyBackupInfo = null;
139142
this.keyBackupFetchedAt = null;
@@ -313,7 +316,7 @@ export default class DeviceListener {
313316
hideSetupEncryptionToast();
314317

315318
this.checkKeyBackupStatus();
316-
} else if (this.shouldShowSetupEncryptionToast()) {
319+
} else if (this.shouldShowSetupEncryptionToast() && !this.shownThisDeviceToast) {
317320
// make sure our keys are finished downloading
318321
await crypto.getUserDeviceInfo([cli.getSafeUserId()]);
319322

@@ -341,6 +344,7 @@ export default class DeviceListener {
341344
}
342345
}
343346
}
347+
this.shownThisDeviceToast = true;
344348
}
345349

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

0 commit comments

Comments
 (0)