From d9c7409a6cf56f6d2e34fa2c2bde83a0cc5fcad7 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 30 Jun 2022 15:09:10 +0900 Subject: [PATCH] enhance(client): show confirm dialog when logout --- locales/ja-JP.yml | 1 + packages/client/src/pages/settings/index.vue | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 17de04ebc..743640725 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -860,6 +860,7 @@ deleteAccount: "アカウント削除" document: "ドキュメント" numberOfPageCache: "ページキャッシュ数" numberOfPageCacheDescription: "多くすると利便性が向上しますが、負荷とメモリ使用量が増えます。" +logoutConfirm: "ログアウトしますか?" _emailUnavailable: used: "既に使用されています" diff --git a/packages/client/src/pages/settings/index.vue b/packages/client/src/pages/settings/index.vue index 011962c2e..8143298cc 100644 --- a/packages/client/src/pages/settings/index.vue +++ b/packages/client/src/pages/settings/index.vue @@ -32,6 +32,7 @@ import { unisonReload } from '@/scripts/unison-reload'; import { instance } from '@/instance'; import { useRouter } from '@/router'; import { definePageMetadata, provideMetadataReceiver, setPageMetadata } from '@/scripts/page-metadata'; +import * as os from '@/os'; const props = withDefaults(defineProps<{ initialPage?: string; @@ -181,7 +182,12 @@ const menuDef = computed(() => [{ type: 'button', icon: 'fas fa-sign-in-alt fa-flip-horizontal', text: i18n.ts.logout, - action: () => { + action: async () => { + const { canceled } = await os.confirm({ + type: 'warning', + text: i18n.ts.logoutConfirm, + }); + if (canceled) return; signout(); }, danger: true,