From 22c4e9d7ecf5a659832ea32244e46a40627bfc8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=8B=E3=81=A3=E3=81=93=E3=81=8B=E3=82=8A?= <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Sat, 27 Jul 2024 18:09:57 +0900 Subject: [PATCH] =?UTF-8?q?fix(frontend):=20modal=E3=81=8C=E6=AD=A3?= =?UTF-8?q?=E3=81=97=E3=81=8F=E9=96=89=E3=81=98=E3=82=89=E3=82=8C=E3=81=A6?= =?UTF-8?q?=E3=81=84=E3=81=AA=E3=81=84=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=20(#14307)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(frontend): modalが正しく閉じられていないのを修正 * Update packages/frontend/src/components/MkSystemWebhookEditor.vue Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com> --------- Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com> --- .../components/MkSystemWebhookEditor.impl.ts | 13 +++++---- .../src/components/MkSystemWebhookEditor.vue | 22 +++++++++----- .../src/components/MkUserSelectDialog.vue | 8 ++--- .../notification-recipient.editor.vue | 29 ++++++++++++------- .../abuse-report/notification-recipient.vue | 15 +++++----- 5 files changed, 53 insertions(+), 34 deletions(-) diff --git a/packages/frontend/src/components/MkSystemWebhookEditor.impl.ts b/packages/frontend/src/components/MkSystemWebhookEditor.impl.ts index 76f54e8d37..69b8edd85a 100644 --- a/packages/frontend/src/components/MkSystemWebhookEditor.impl.ts +++ b/packages/frontend/src/components/MkSystemWebhookEditor.impl.ts @@ -24,22 +24,23 @@ export type MkSystemWebhookResult = { }; export async function showSystemWebhookEditorDialog(props: MkSystemWebhookEditorProps): Promise { - const { dispose, result } = await new Promise<{ dispose: () => void, result: MkSystemWebhookResult | null }>(async resolve => { - const { dispose: _dispose } = os.popup( + const { result } = await new Promise<{ result: MkSystemWebhookResult | null }>(async resolve => { + const { dispose } = os.popup( defineAsyncComponent(() => import('@/components/MkSystemWebhookEditor.vue')), props, { submitted: (ev: MkSystemWebhookResult) => { - resolve({ dispose: _dispose, result: ev }); + resolve({ result: ev }); + }, + canceled: () => { + resolve({ result: null }); }, closed: () => { - resolve({ dispose: _dispose, result: null }); + dispose(); }, }, ); }); - dispose(); - return result; } diff --git a/packages/frontend/src/components/MkSystemWebhookEditor.vue b/packages/frontend/src/components/MkSystemWebhookEditor.vue index 007d841f00..3e6a015018 100644 --- a/packages/frontend/src/components/MkSystemWebhookEditor.vue +++ b/packages/frontend/src/components/MkSystemWebhookEditor.vue @@ -5,6 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only