From 81f32f8ccac6004df9f64fd87b73328b9172a76b Mon Sep 17 00:00:00 2001 From: Baptiste Grob <60621355+baptiste-grob@users.noreply.github.com> Date: Mon, 29 Jun 2020 12:57:52 +0200 Subject: [PATCH] cleanup: accountMenu --- .../directives/views/accountMenu.ts | 26 ++++++++----------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/app/assets/javascripts/directives/views/accountMenu.ts b/app/assets/javascripts/directives/views/accountMenu.ts index 005e930ad..544d7fdb5 100644 --- a/app/assets/javascripts/directives/views/accountMenu.ts +++ b/app/assets/javascripts/directives/views/accountMenu.ts @@ -19,9 +19,10 @@ import { STRING_GENERATING_REGISTER_KEYS, StringImportError } 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 { 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'; @@ -338,18 +339,13 @@ class AccountMenuCtrl extends PureViewCtrl { } } - destroyLocalData() { - this.application!.alertService!.confirm( - STRING_SIGN_OUT_CONFIRMATION, - undefined, - undefined, - undefined, - async () => { - await this.application!.signOut(); - }, - undefined, - true, - ); + async destroyLocalData() { + if (await confirmDialog({ + text: STRING_SIGN_OUT_CONFIRMATION, + confirmButtonStyle: "danger" + })) { + this.application.signOut(); + } } async submitImportPassword() { @@ -377,7 +373,7 @@ class AccountMenuCtrl extends PureViewCtrl { } /** - * @template + * @template */ async importFileSelected(files: File[]) { const run = async () => {