From 050266ee39811afd7a513c3e7f6d29d331d88f4f Mon Sep 17 00:00:00 2001 From: tusooa Date: Fri, 10 Mar 2023 19:28:08 -0500 Subject: [PATCH] Abandon draft after all postings --- src/components/draft/draft.js | 4 ---- src/components/draft/draft.vue | 2 -- src/components/post_status_form/post_status_form.js | 4 ++++ 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/components/draft/draft.js b/src/components/draft/draft.js index f5f44467..ffc3671a 100644 --- a/src/components/draft/draft.js +++ b/src/components/draft/draft.js @@ -58,10 +58,6 @@ const Draft = { }, hideConfirmDialog () { this.showingConfirmDialog = false - }, - handlePosted () { - console.debug('posted') - this.doAbandon() } } } diff --git a/src/components/draft/draft.vue b/src/components/draft/draft.vue index 43b14721..cc385c14 100644 --- a/src/components/draft/draft.vue +++ b/src/components/draft/draft.vue @@ -48,12 +48,10 @@ diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index 7b6bc293..49395947 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -385,6 +385,7 @@ const PostStatusForm = { postHandler(postingOptions).then((data) => { if (!data.error) { + this.abandonDraft() this.clearStatus() this.$emit('posted', data) } else { @@ -673,6 +674,9 @@ const PostStatusForm = { }) } }, + abandonDraft () { + this.$store.dispatch('abandonDraft', { id: this.newStatus.id }) + }, getDraft (statusType, refId) { console.debug('type and ref:', [statusType, refId])