diff --git a/packages/frontend/src/components/MkUserSetupDialog.Profile.vue b/packages/frontend/src/components/MkUserSetupDialog.Profile.vue index 9f1bd608f84b..b237cb596b04 100644 --- a/packages/frontend/src/components/MkUserSetupDialog.Profile.vue +++ b/packages/frontend/src/components/MkUserSetupDialog.Profile.vue @@ -51,14 +51,11 @@ watch(name, () => { // 空文字列をnullにしたいので??は使うな // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing name: name.value || null, - }, undefined, null, err => { - if (err.code === 'SCREEN_NAME_CONTAINS_PROHIBITED_WORDS') { - os.alert({ - type: 'error', - title: i18n.ts.screenNameContainsProhibitedWords, - text: i18n.ts.screenNameContainsProhibitedWordsDescription, - }); - } + }, undefined, { + '0b3f9f6a-2f4d-4b1f-9fb4-49d3a2fd7191': { + title: i18n.ts.screenNameContainsProhibitedWords, + text: i18n.ts.screenNameContainsProhibitedWordsDescription, + }, }); }); diff --git a/packages/frontend/src/os.ts b/packages/frontend/src/os.ts index e1a3e6d0907d..0ff3a31f3bd3 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,6 +78,9 @@ export const apiWithDialog = ( { - if (err.code === 'SCREEN_NAME_CONTAINS_PROHIBITED_WORDS') { - os.alert({ - type: 'error', - title: i18n.ts.screenNameContainsProhibitedWords, - text: i18n.ts.screenNameContainsProhibitedWordsDescription, - }); - } + }, undefined, { + '0b3f9f6a-2f4d-4b1f-9fb4-49d3a2fd7191': { + title: i18n.ts.screenNameContainsProhibitedWords, + text: i18n.ts.screenNameContainsProhibitedWordsDescription, + }, }); globalEvents.emit('requestClearPageCache'); claimAchievement('profileFilled'); diff --git a/packages/frontend/src/scripts/get-note-menu.ts b/packages/frontend/src/scripts/get-note-menu.ts index 4ffa0ab94d2f..c1846b058957 100644 --- a/packages/frontend/src/scripts/get-note-menu.ts +++ b/packages/frontend/src/scripts/get-note-menu.ts @@ -245,13 +245,10 @@ export function getNoteMenu(props: { function togglePin(pin: boolean): void { os.apiWithDialog(pin ? 'i/pin' : 'i/unpin', { noteId: appearNote.id, - }, undefined, null, res => { - if (res.id === '72dab508-c64d-498f-8740-a8eec1ba385a') { - os.alert({ - type: 'error', - text: i18n.ts.pinLimitExceeded, - }); - } + }, undefined, { + '72dab508-c64d-498f-8740-a8eec1ba385a': { + text: i18n.ts.pinLimitExceeded, + }, }); }