diff options
| author | かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com> | 2024-07-27 18:09:57 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-27 18:09:57 +0900 |
| commit | 22c4e9d7ecf5a659832ea32244e46a40627bfc8f (patch) | |
| tree | 4aefe2232b158b74ef376564047d2cbedd96c241 /packages/frontend/src/pages/admin/abuse-report | |
| parent | fix(build): autogen生成時にbackendを2度buildしているのを修正 (#... (diff) | |
| download | misskey-22c4e9d7ecf5a659832ea32244e46a40627bfc8f.tar.gz misskey-22c4e9d7ecf5a659832ea32244e46a40627bfc8f.tar.bz2 misskey-22c4e9d7ecf5a659832ea32244e46a40627bfc8f.zip | |
fix(frontend): modalが正しく閉じられていないのを修正 (#14307)
* 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>
Diffstat (limited to 'packages/frontend/src/pages/admin/abuse-report')
| -rw-r--r-- | packages/frontend/src/pages/admin/abuse-report/notification-recipient.editor.vue | 29 | ||||
| -rw-r--r-- | packages/frontend/src/pages/admin/abuse-report/notification-recipient.vue | 15 |
2 files changed, 27 insertions, 17 deletions
diff --git a/packages/frontend/src/pages/admin/abuse-report/notification-recipient.editor.vue b/packages/frontend/src/pages/admin/abuse-report/notification-recipient.editor.vue index ffe9c620d6..015109f54e 100644 --- a/packages/frontend/src/pages/admin/abuse-report/notification-recipient.editor.vue +++ b/packages/frontend/src/pages/admin/abuse-report/notification-recipient.editor.vue @@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only <template> <MkModalWindow - ref="dialog" + ref="dialogEl" :width="400" :height="490" :withOkButton="false" @@ -71,7 +71,7 @@ SPDX-License-Identifier: AGPL-3.0-only </template> <script lang="ts" setup> -import { computed, onMounted, ref, toRefs } from 'vue'; +import { computed, onMounted, ref, shallowRef, toRefs } from 'vue'; import { entities } from 'misskey-js'; import MkButton from '@/components/MkButton.vue'; import MkModalWindow from '@/components/MkModalWindow.vue'; @@ -88,6 +88,7 @@ type NotificationRecipientMethod = 'email' | 'webhook'; const emit = defineEmits<{ (ev: 'submitted'): void; + (ev: 'canceled'): void; (ev: 'closed'): void; }>(); @@ -98,6 +99,8 @@ const props = defineProps<{ const { mode, id } = toRefs(props); +const dialogEl = shallowRef<InstanceType<typeof MkModalWindow>>(); + const loading = ref<number>(0); const title = ref<string>(''); @@ -166,18 +169,21 @@ async function onSubmitClicked() { } } + dialogEl.value?.close(); emit('submitted'); - // eslint-disable-next-line + // eslint-disable-next-line @typescript-eslint/no-explicit-any } catch (ex: any) { const msg = ex.message ?? i18n.ts.internalServerErrorDescription; await os.alert({ type: 'error', title: i18n.ts.error, text: msg }); - emit('closed'); + dialogEl.value?.close(); + emit('canceled'); } }); } function onCancelClicked() { - emit('closed'); + dialogEl.value?.close(); + emit('canceled'); } async function onEditSystemWebhookClicked() { @@ -262,7 +268,8 @@ onMounted(async () => { } catch (ex: any) { const msg = ex.message ?? i18n.ts.internalServerErrorDescription; await os.alert({ type: 'error', title: i18n.ts.error, text: msg }); - emit('closed'); + dialogEl.value?.close(); + emit('canceled'); } } else { userId.value = moderators.value[0]?.id ?? null; @@ -296,11 +303,13 @@ onMounted(async () => { gap: 8px; button { - width: 2.5em; - height: 2.5em; - min-width: 2.5em; - min-height: 2.5em; + min-width: 0; + min-height: 0; + width: 34px; + height: 34px; + flex-shrink: 0; box-sizing: border-box; + margin: 1px 0; padding: 6px; } } diff --git a/packages/frontend/src/pages/admin/abuse-report/notification-recipient.vue b/packages/frontend/src/pages/admin/abuse-report/notification-recipient.vue index 93800873f9..f5249261be 100644 --- a/packages/frontend/src/pages/admin/abuse-report/notification-recipient.vue +++ b/packages/frontend/src/pages/admin/abuse-report/notification-recipient.vue @@ -108,26 +108,27 @@ async function onDeleteButtonClicked(id: string) { } async function showEditor(mode: 'create' | 'edit', id?: string) { - const { dispose, needLoad } = await new Promise<{ dispose: () => void, needLoad: boolean }>(async resolve => { - const { dispose: _dispose } = os.popup( + const { needLoad } = await new Promise<{ needLoad: boolean }>(async resolve => { + const { dispose } = os.popup( defineAsyncComponent(() => import('./notification-recipient.editor.vue')), { mode, id, }, { - submitted: async () => { - resolve({ dispose: _dispose, needLoad: true }); + submitted: () => { + resolve({ needLoad: true }); + }, + canceled: () => { + resolve({ needLoad: false }); }, closed: () => { - resolve({ dispose: _dispose, needLoad: false }); + dispose(); }, }, ); }); - dispose(); - if (needLoad) { await fetchRecipients(); } |