diff --git a/packages/frontend/src/components/MkPostForm.vue b/packages/frontend/src/components/MkPostForm.vue index 578fc4274..80e856946 100644 --- a/packages/frontend/src/components/MkPostForm.vue +++ b/packages/frontend/src/components/MkPostForm.vue @@ -162,7 +162,9 @@ const props = withDefaults(defineProps<{ provide('mock', props.mock); const emit = defineEmits<{ + (ev: 'posting'): void; (ev: 'posted'): void; + (ev: 'postError'): void; (ev: 'cancel'): void; (ev: 'esc'): void; @@ -861,7 +863,9 @@ async function post(ev?: MouseEvent) { type: 'error', text: err.message + '\n' + (err as any).id, }); + emit("postError"); }); + emit("posting"); } function cancel() { diff --git a/packages/frontend/src/components/MkPostFormDialog.vue b/packages/frontend/src/components/MkPostFormDialog.vue index 6331dfed2..a59087c4a 100644 --- a/packages/frontend/src/components/MkPostFormDialog.vue +++ b/packages/frontend/src/components/MkPostFormDialog.vue @@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only @@ -14,6 +14,7 @@ import { shallowRef } from 'vue'; import * as Misskey from 'misskey-js'; import MkModal from '@/components/MkModal.vue'; import MkPostForm from '@/components/MkPostForm.vue'; +import * as os from '@/os.js'; const props = defineProps<{ reply?: Misskey.entities.Note; @@ -40,12 +41,16 @@ const emit = defineEmits<{ const modal = shallowRef>(); const form = shallowRef>(); -function onPosted() { +function onPosting() { modal.value?.close({ useSendAnimation: true, }); } +function onPostError() { + os.post(); +} + function onModalClosed() { emit('closed'); }