Abandon draft after all postings

This commit is contained in:
tusooa 2023-03-10 19:28:08 -05:00
parent 8d27c68d5f
commit 050266ee39
No known key found for this signature in database
GPG Key ID: 42AEC43D48433C51
3 changed files with 4 additions and 6 deletions

View File

@ -58,10 +58,6 @@ const Draft = {
}, },
hideConfirmDialog () { hideConfirmDialog () {
this.showingConfirmDialog = false this.showingConfirmDialog = false
},
handlePosted () {
console.debug('posted')
this.doAbandon()
} }
} }
} }

View File

@ -48,12 +48,10 @@
<PostStatusForm <PostStatusForm
v-if="draft.type !== 'edit'" v-if="draft.type !== 'edit'"
v-bind="postStatusFormProps" v-bind="postStatusFormProps"
@posted="handlePosted"
/> />
<EditStatusForm <EditStatusForm
v-else v-else
:params="postStatusFormProps" :params="postStatusFormProps"
@posted="handlePosted"
/> />
</div> </div>
<teleport to="#modal"> <teleport to="#modal">

View File

@ -385,6 +385,7 @@ const PostStatusForm = {
postHandler(postingOptions).then((data) => { postHandler(postingOptions).then((data) => {
if (!data.error) { if (!data.error) {
this.abandonDraft()
this.clearStatus() this.clearStatus()
this.$emit('posted', data) this.$emit('posted', data)
} else { } else {
@ -673,6 +674,9 @@ const PostStatusForm = {
}) })
} }
}, },
abandonDraft () {
this.$store.dispatch('abandonDraft', { id: this.newStatus.id })
},
getDraft (statusType, refId) { getDraft (statusType, refId) {
console.debug('type and ref:', [statusType, refId]) console.debug('type and ref:', [statusType, refId])