commit: 747bad79fcacf6659b75bc46c76eb85fe58efed7
parent e67e5ff8992409dfc1d312da93e5e2d6b712663f
Author: tusooa <tusooa@kazv.moe>
Date: Fri, 10 Mar 2023 19:36:54 -0500
Handle situations where draft should be saved
Diffstat:
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js
@@ -201,7 +201,8 @@ const PostStatusForm = {
preview: null,
previewLoading: false,
emojiInputShown: false,
- idempotencyKey: ''
+ idempotencyKey: '',
+ saveInhibited: true
}
},
computed: {
@@ -340,9 +341,11 @@ const PostStatusForm = {
this.autoPreview()
this.updateIdempotencyKey()
this.debouncedSaveDraft()
+ this.saveInhibited = false
},
clearStatus () {
const newStatus = this.newStatus
+ this.saveInhibited = true
this.newStatus = {
status: '',
spoilerText: '',
@@ -698,7 +701,7 @@ const PostStatusForm = {
return propsToNative(props)
},
saveDraft () {
- if (this.newStatus.status) {
+ if (!this.saveInhibited) {
console.debug('Saving status', this.newStatus)
this.$store.dispatch('addOrSaveDraft', { draft: this.newStatus })
.then(id => {