From 8b214f8247e0f5fa2bb17108a9eff3eea612593e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=B0=B4=E5=92=B2=28=E3=81=BF=E3=81=95=E3=81=8D=29?=
<60120497+Misaki0331@users.noreply.github.com>
Date: Thu, 11 Apr 2024 18:27:27 +0900
Subject: [PATCH] =?UTF-8?q?enhance(frontend/MkPostForm):=20=E3=83=8E?=
=?UTF-8?q?=E3=83=BC=E3=83=88=E3=81=AE=E6=8A=95=E7=A8=BF=E5=BE=8C=E3=81=99?=
=?UTF-8?q?=E3=81=90=E3=81=AB=E6=8A=95=E7=A8=BF=E3=83=A2=E3=83=BC=E3=83=80?=
=?UTF-8?q?=E3=83=AB=E3=82=92=E9=96=89=E3=81=98=E3=82=8B=E3=82=88=E3=81=86?=
=?UTF-8?q?=E3=81=AB=20(MisskeyIO#605)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
packages/frontend/src/components/MkPostForm.vue | 4 ++++
packages/frontend/src/components/MkPostFormDialog.vue | 9 +++++++--
2 files changed, 11 insertions(+), 2 deletions(-)
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');
}