logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://anongit.hacktivis.me/git/pleroma-fe.git/
commit: d0228728f4214059ec9663351cb102e711eb63bd
parent a18854a30d5a687ee3a2a028aa2a7e1b73b5597c
Author: Henry Jameson <me@hjkos.com>
Date:   Tue,  7 Jan 2025 17:39:47 +0200

Close dialog on draft save/abandon without promting to save. Fixes #1351

Diffstat:

Msrc/components/edit_status_modal/edit_status_modal.vue1+
Msrc/components/post_status_form/post_status_form.js3+++
Msrc/components/post_status_form/post_status_form.vue2+-
Msrc/components/post_status_modal/post_status_modal.vue1+
Msrc/components/status/status.vue1+
5 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/components/edit_status_modal/edit_status_modal.vue b/src/components/edit_status_modal/edit_status_modal.vue @@ -15,6 +15,7 @@ class="panel-body" :params="params" @posted="doCloseModal" + @draft-done="doCloseModal" @can-close="doCloseModal" /> </div> diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js @@ -116,6 +116,7 @@ const PostStatusForm = { ], emits: [ 'posted', + 'draft-done', 'resize', 'mediaplay', 'mediapause', @@ -761,12 +762,14 @@ const PostStatusForm = { this.newStatus.id = id } this.saveable = false + this.$emit('draft-done') }) } else if (this.newStatus.id) { // There is a draft, but there is nothing in it, clear it return this.abandonDraft() .then(() => { this.saveable = false + 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 @@ -339,7 +339,7 @@ v-if="!hideDraft" class="menu-item dropdown-item dropdown-item-icon" role="menu" - :disabled="!safeToSaveDraft" + :disabled="!safeToSaveDraft && saveable" :class="{ disabled: !safeToSaveDraft }" @click.prevent="saveDraft" @click="close" diff --git a/src/components/post_status_modal/post_status_modal.vue b/src/components/post_status_modal/post_status_modal.vue @@ -15,6 +15,7 @@ class="panel-body" v-bind="params" @posted="resetAndClose" + @draft-done="resetAndClose" /> </div> </Modal> diff --git a/src/components/status/status.vue b/src/components/status/status.vue @@ -606,6 +606,7 @@ :copy-message-scope="status.visibility" :subject="replySubject" @posted="doToggleReplying" + @draft-done="doToggleReplying" @can-close="doToggleReplying" /> </div>