From 6fd63c1fb65432872455fc8b268edd7843fdb45e Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 8 May 2023 17:49:19 +0900 Subject: [PATCH] tweak of #10799 --- locales/ja-JP.yml | 1 + .../frontend/src/components/MkUserSetupDialog.vue | 15 ++++++++++++--- packages/frontend/src/init.ts | 3 +++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index c3dc2172c..b886cc7bf 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1050,6 +1050,7 @@ _initialAccountSetting: initialAccountSettingCompleted: "初期設定が完了しました!" haveFun: "{name}をお楽しみください!" ifYouNeedLearnMore: "{name}(Misskey)の使い方などを詳しく知るには{link}をご覧ください。" + skipAreYouSure: "初期設定をスキップしますか?" _serverRules: description: "新規登録前に表示する、サーバーの簡潔なルールを設定します。内容は利用規約の要約とすることを推奨します。" diff --git a/packages/frontend/src/components/MkUserSetupDialog.vue b/packages/frontend/src/components/MkUserSetupDialog.vue index 58afe09b6..a9d117e07 100644 --- a/packages/frontend/src/components/MkUserSetupDialog.vue +++ b/packages/frontend/src/components/MkUserSetupDialog.vue @@ -3,7 +3,7 @@ ref="dialog" :width="500" :height="550" - @close="close" + @close="close(true)" @closed="emit('closed')" > @@ -70,7 +70,7 @@
{{ i18n.t('_initialAccountSetting.haveFun', { name: instance.name ?? host }) }}
- {{ i18n.ts.close }} + {{ i18n.ts.close }} @@ -91,6 +91,7 @@ import { instance } from '@/instance'; import { host } from '@/config'; import MkPushNotificationAllowButton from '@/components/MkPushNotificationAllowButton.vue'; import { defaultStore } from '@/store'; +import * as os from '@/os'; const emit = defineEmits<{ (ev: 'closed'): void; @@ -104,7 +105,15 @@ watch(page, () => { defaultStore.set('accountSetupWizard', page.value); }); -function close() { +async function close(skip: boolean) { + if (skip) { + const { canceled } = await os.confirm({ + type: 'warning', + text: i18n.ts._initialAccountSetting.skipAreYouSure, + }); + if (canceled) return; + } + dialog.value.close(); defaultStore.set('accountSetupWizard', -1); } diff --git a/packages/frontend/src/init.ts b/packages/frontend/src/init.ts index eb6780324..49e7bb400 100644 --- a/packages/frontend/src/init.ts +++ b/packages/frontend/src/init.ts @@ -345,8 +345,11 @@ if ($i) { if (defaultStore.state.accountSetupWizard !== -1) { // このウィザードが実装される前に登録したユーザーには表示させないため + // TODO: そのうち消す if (Date.now() - new Date($i.createdAt).getTime() < 1000 * 60 * 60 * 24) { popup(defineAsyncComponent(() => import('@/components/MkUserSetupDialog.vue')), {}, {}, 'closed'); + } else { + defaultStore.set('accountSetupWizard', -1); } }