Replace the native confirm and alert with an in-app dialog. [skip build]
This commit is contained in:
+13
-11
@@ -5,6 +5,7 @@ import { clearNavToActivePathStore } from '../app/state/navToActivePath';
|
||||
import { Session, getSessionStoreName } from '../app/state/sessions';
|
||||
import { getSettings } from '../app/state/settings';
|
||||
import { recordPacket } from '../app/state/debugPackets';
|
||||
import { promptDialog } from '../app/state/dialog';
|
||||
|
||||
const MAX_BODY = 8192;
|
||||
|
||||
@@ -242,17 +243,18 @@ const setupKeyConflictHandler = (mx: MatrixClient, session: Session): void => {
|
||||
|
||||
// Notify user and reload
|
||||
setTimeout(() => {
|
||||
if (
|
||||
confirm(
|
||||
'Detected encryption key conflict. The app needs to reset your encryption session. You may need to re-verify your devices after this. Continue?',
|
||||
)
|
||||
) {
|
||||
deleteRustCryptoDatabase(session).then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
} else {
|
||||
handlingKeyConflict = false;
|
||||
}
|
||||
promptDialog(
|
||||
'Detected encryption key conflict. The app needs to reset your encryption session. You may need to re-verify your devices after this. Continue?',
|
||||
true,
|
||||
).then((continueFix) => {
|
||||
if (continueFix) {
|
||||
deleteRustCryptoDatabase(session).then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
} else {
|
||||
handlingKeyConflict = false;
|
||||
}
|
||||
});
|
||||
}, 100);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user