From e21e2530e6067c1d5ba2b9f49c03333ef94367bc Mon Sep 17 00:00:00 2001
From: Marie <github@yuugi.dev>
Date: Mon, 16 Sep 2024 00:35:26 +0200
Subject: fix: don't show quoted toast on cancel of quote note

---
 packages/frontend/src/components/MkPostFormDialog.vue | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

(limited to 'packages/frontend/src/components/MkPostFormDialog.vue')

diff --git a/packages/frontend/src/components/MkPostFormDialog.vue b/packages/frontend/src/components/MkPostFormDialog.vue
index 947c0ee4d0..cc84c6e0ff 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
 
 <template>
 <MkModal ref="modal" :preferType="'dialog'" @click="modal?.close()" @closed="onModalClosed()" @esc="modal?.close()">
-	<MkPostForm ref="form" :class="$style.form" v-bind="props" autofocus freezeAfterPosted @posted="onPosted" @cancel="modal?.close()" @esc="modal?.close()"/>
+	<MkPostForm ref="form" :class="$style.form" v-bind="props" autofocus freezeAfterPosted @posted="onPosted" @cancel="onCancel" @esc="modal?.close()"/>
 </MkModal>
 </template>
 
@@ -37,7 +37,7 @@ const props = withDefaults(defineProps<{
 });
 
 const emit = defineEmits<{
-	(ev: 'closed'): void;
+	(ev: 'closed', cancelled: boolean): void;
 }>();
 
 const modal = shallowRef<InstanceType<typeof MkModal>>();
@@ -47,10 +47,16 @@ function onPosted() {
 	modal.value?.close({
 		useSendAnimation: true,
 	});
+	emit('closed', false);
+}
+
+function onCancel() {
+	modal.value?.close();
+	emit('closed', true);
 }
 
 function onModalClosed() {
-	emit('closed');
+	emit('closed', true);
 }
 </script>
 
-- 
cgit v1.2.3-freya

