feat: prevent refreshing when setting passcode

This commit is contained in:
Baptiste Grob
2020-08-26 17:32:00 +02:00
parent c4506a5407
commit 5b72f4e88f
4 changed files with 29 additions and 17 deletions

View File

@@ -1,5 +1,5 @@
import { FooterStatus, WebDirective } from '@/types';
import { dateToLocalizedString } from '@/utils';
import { dateToLocalizedString, preventRefreshing } from '@/utils';
import {
ApplicationEvent,
SyncQueueStrategy,
@@ -309,13 +309,9 @@ class FooterViewCtrl extends PureViewCtrl<{}, {
}
async openSecurityUpdate() {
const onBeforeUnload = window.onbeforeunload;
try {
window.onbeforeunload = () => STRING_CONFIRM_APP_QUIT_DURING_UPGRADE;
preventRefreshing(STRING_CONFIRM_APP_QUIT_DURING_UPGRADE, async () => {
await this.application!.performProtocolUpgrade();
} finally {
window.onbeforeunload = onBeforeUnload;
}
});
}
findErrors() {