cleanup: accountMenu

This commit is contained in:
Baptiste Grob
2020-06-29 12:57:52 +02:00
parent 9e2df37e21
commit 81f32f8cca

View File

@@ -19,9 +19,10 @@ import {
STRING_GENERATING_REGISTER_KEYS, STRING_GENERATING_REGISTER_KEYS,
StringImportError StringImportError
} from '@/strings'; } from '@/strings';
import { SyncOpStatus } from '@node_modules/snjs/dist/@types/services/sync/sync_op_status'; import { SyncOpStatus } from 'snjs/dist/@types/services/sync/sync_op_status';
import { PasswordWizardType } from '@/types'; import { PasswordWizardType } from '@/types';
import { BackupFile } from '@node_modules/snjs/dist/@types/services/protocol_service'; import { BackupFile } from 'snjs/dist/@types/services/protocol_service';
import { confirmDialog } from '@/services/alertService';
const ELEMENT_ID_IMPORT_PASSWORD_INPUT = 'import-password-request'; const ELEMENT_ID_IMPORT_PASSWORD_INPUT = 'import-password-request';
@@ -338,18 +339,13 @@ class AccountMenuCtrl extends PureViewCtrl {
} }
} }
destroyLocalData() { async destroyLocalData() {
this.application!.alertService!.confirm( if (await confirmDialog({
STRING_SIGN_OUT_CONFIRMATION, text: STRING_SIGN_OUT_CONFIRMATION,
undefined, confirmButtonStyle: "danger"
undefined, })) {
undefined, this.application.signOut();
async () => { }
await this.application!.signOut();
},
undefined,
true,
);
} }
async submitImportPassword() { async submitImportPassword() {
@@ -377,7 +373,7 @@ class AccountMenuCtrl extends PureViewCtrl {
} }
/** /**
* @template * @template
*/ */
async importFileSelected(files: File[]) { async importFileSelected(files: File[]) {
const run = async () => { const run = async () => {