From d7c5f3119195ba446132df33f7a5e938dc8b7ab7 Mon Sep 17 00:00:00 2001 From: yukineko <27853966+hideki0403@users.noreply.github.com> Date: Thu, 18 Apr 2024 19:42:11 +0900 Subject: [PATCH] =?UTF-8?q?enhance:=20=E6=97=A2=E3=81=AB=E5=85=A5=E5=8A=9B?= =?UTF-8?q?=E3=81=95=E3=82=8C=E3=81=A6=E3=81=84=E3=82=8B=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E3=81=8C=E3=81=82=E3=82=8B=E5=A0=B4=E5=90=88=E3=81=AB=E4=B8=8A?= =?UTF-8?q?=E6=9B=B8=E3=81=8D=E8=AD=A6=E5=91=8A=E3=82=92=E5=87=BA=E3=81=99?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/frontend/src/components/MkPostForm.vue | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/frontend/src/components/MkPostForm.vue b/packages/frontend/src/components/MkPostForm.vue index f6440baec0..5379cf7238 100644 --- a/packages/frontend/src/components/MkPostForm.vue +++ b/packages/frontend/src/components/MkPostForm.vue @@ -775,6 +775,15 @@ function chooseDraft() { }, { selected: async (res) => { const draft = await res as noteDrafts.NoteDraft; + + if (text.value !== '' || files.value.length > 0) { + const { canceled } = await os.confirm({ + type: 'warning', + text: i18n.ts.draftOverwriteConfirm, + }); + if (canceled) return; + } + applyDraft(draft); }, }, 'closed'); @@ -786,12 +795,14 @@ async function applyDraft(draft: noteDrafts.NoteDraft, native = false) { case 'quote': { await os.apiWithDialog('notes/show', { noteId: draft.auxId as string }).then(note => { renote.value = note; + reply.value = undefined; }); break; } case 'reply': { await os.apiWithDialog('notes/show', { noteId: draft.auxId as string }).then(note => { reply.value = note; + renote.value = undefined; }); break; }