From 5670b29cfa18a3894d0c2abfe0e5ef862e3b9ffa Mon Sep 17 00:00:00 2001 From: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Sat, 12 Oct 2024 10:55:41 +0900 Subject: [PATCH] better error handling --- .../src/components/MkUserSetupDialog.Profile.vue | 5 +++++ packages/frontend/src/os.ts | 9 +++++---- packages/frontend/src/pages/settings/profile.vue | 5 +++++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/packages/frontend/src/components/MkUserSetupDialog.Profile.vue b/packages/frontend/src/components/MkUserSetupDialog.Profile.vue index 3194641cdb..e61ecd0f84 100644 --- a/packages/frontend/src/components/MkUserSetupDialog.Profile.vue +++ b/packages/frontend/src/components/MkUserSetupDialog.Profile.vue @@ -51,6 +51,11 @@ watch(name, () => { // 空文字列をnullにしたいので??は使うな // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing name: name.value || null, + }, undefined, { + 'SCREEN_NAME_CONTAINS_PROHIBITED_WORDS': { + title: i18n.ts.screenNameContainsProhibitedWords, + text: i18n.ts.screenNameContainsProhibitedWordsDescription, + }, }); }); diff --git a/packages/frontend/src/os.ts b/packages/frontend/src/os.ts index 7b4bedd47a..b05155633f 100644 --- a/packages/frontend/src/os.ts +++ b/packages/frontend/src/os.ts @@ -35,6 +35,7 @@ export const apiWithDialog = (, ) => { const promise = misskeyApi(endpoint, data, token); promiseDialog(promise, null, async (err) => { @@ -77,9 +78,9 @@ export const apiWithDialog = (>( promise: T, diff --git a/packages/frontend/src/pages/settings/profile.vue b/packages/frontend/src/pages/settings/profile.vue index 2d26638e10..a185f8f671 100644 --- a/packages/frontend/src/pages/settings/profile.vue +++ b/packages/frontend/src/pages/settings/profile.vue @@ -206,6 +206,11 @@ function save() { lang: profile.lang || null, isBot: !!profile.isBot, isCat: !!profile.isCat, + }, undefined, { + 'SCREEN_NAME_CONTAINS_PROHIBITED_WORDS': { + title: i18n.ts.screenNameContainsProhibitedWords, + text: i18n.ts.screenNameContainsProhibitedWordsDescription, + }, }); globalEvents.emit('requestClearPageCache'); claimAchievement('profileFilled');