diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index 00ee58866..71d6615f4 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -102,6 +102,7 @@ const PostStatusForm = { 'disablePreview', 'disableDraft', 'hideDraft', + 'closeable', 'placeholder', 'maxHeight', 'postHandler', @@ -234,6 +235,9 @@ const PostStatusForm = { showAllScopes () { return !this.mergedConfig.minimalScopesMode }, + hideExtraActions () { + return this.disableDraft || this.hideDraft + }, emojiUserSuggestor () { return suggestor({ emoji: [ @@ -355,10 +359,12 @@ const PostStatusForm = { } }, safeToSaveDraft () { - return this.newStatus.status || + return ( + this.newStatus.status || this.newStatus.spoilerText || this.newStatus.files?.length || this.newStatus.hasPoll + ) && this.saveable }, ...mapGetters(['mergedConfig']), ...mapState({ @@ -762,6 +768,7 @@ const PostStatusForm = { this.newStatus.id = id } this.saveable = false + this.clearStatus() this.$emit('draft-done') }) } else if (this.newStatus.id) { @@ -769,6 +776,7 @@ const PostStatusForm = { return this.abandonDraft() .then(() => { this.saveable = false + this.clearStatus() this.$emit('draft-done') }) } diff --git a/src/components/post_status_form/post_status_form.vue b/src/components/post_status_form/post_status_form.vue index ac5a6ce4f..220d3e975 100644 --- a/src/components/post_status_form/post_status_form.vue +++ b/src/components/post_status_form/post_status_form.vue @@ -316,13 +316,12 @@ diff --git a/src/components/post_status_modal/post_status_modal.vue b/src/components/post_status_modal/post_status_modal.vue index 054da0c64..414dd5bd1 100644 --- a/src/components/post_status_modal/post_status_modal.vue +++ b/src/components/post_status_modal/post_status_modal.vue @@ -14,6 +14,7 @@ diff --git a/src/components/status/status.vue b/src/components/status/status.vue index cecc9d69e..408e6c52b 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -598,6 +598,7 @@