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

This commit is contained in:
Henry Jameson 2025-01-07 17:39:47 +02:00
parent a18854a30d
commit d0228728f4
5 changed files with 7 additions and 1 deletions

View file

@ -15,6 +15,7 @@
class="panel-body" class="panel-body"
:params="params" :params="params"
@posted="doCloseModal" @posted="doCloseModal"
@draft-done="doCloseModal"
@can-close="doCloseModal" @can-close="doCloseModal"
/> />
</div> </div>

View file

@ -116,6 +116,7 @@ const PostStatusForm = {
], ],
emits: [ emits: [
'posted', 'posted',
'draft-done',
'resize', 'resize',
'mediaplay', 'mediaplay',
'mediapause', 'mediapause',
@ -761,12 +762,14 @@ const PostStatusForm = {
this.newStatus.id = id this.newStatus.id = id
} }
this.saveable = false this.saveable = false
this.$emit('draft-done')
}) })
} else if (this.newStatus.id) { } else if (this.newStatus.id) {
// There is a draft, but there is nothing in it, clear it // There is a draft, but there is nothing in it, clear it
return this.abandonDraft() return this.abandonDraft()
.then(() => { .then(() => {
this.saveable = false this.saveable = false
this.$emit('draft-done')
}) })
} }
} }

View file

@ -339,7 +339,7 @@
v-if="!hideDraft" v-if="!hideDraft"
class="menu-item dropdown-item dropdown-item-icon" class="menu-item dropdown-item dropdown-item-icon"
role="menu" role="menu"
:disabled="!safeToSaveDraft" :disabled="!safeToSaveDraft && saveable"
:class="{ disabled: !safeToSaveDraft }" :class="{ disabled: !safeToSaveDraft }"
@click.prevent="saveDraft" @click.prevent="saveDraft"
@click="close" @click="close"

View file

@ -15,6 +15,7 @@
class="panel-body" class="panel-body"
v-bind="params" v-bind="params"
@posted="resetAndClose" @posted="resetAndClose"
@draft-done="resetAndClose"
/> />
</div> </div>
</Modal> </Modal>

View file

@ -606,6 +606,7 @@
:copy-message-scope="status.visibility" :copy-message-scope="status.visibility"
:subject="replySubject" :subject="replySubject"
@posted="doToggleReplying" @posted="doToggleReplying"
@draft-done="doToggleReplying"
@can-close="doToggleReplying" @can-close="doToggleReplying"
/> />
</div> </div>