Fix draft saving and add tests
This commit is contained in:
parent
9e2086edaf
commit
690812f27c
8 changed files with 364 additions and 2 deletions
|
|
@ -376,6 +376,14 @@ const PostStatusForm = {
|
|||
this.newStatus.hasPoll
|
||||
) && this.saveable
|
||||
},
|
||||
hasEmptyDraft () {
|
||||
return this.newStatus.id && !(
|
||||
this.newStatus.status ||
|
||||
this.newStatus.spoilerText ||
|
||||
this.newStatus.files?.length ||
|
||||
this.newStatus.hasPoll
|
||||
)
|
||||
},
|
||||
...mapGetters(['mergedConfig']),
|
||||
...mapState(useInterfaceStore, {
|
||||
mobileLayout: store => store.mobileLayout
|
||||
|
|
@ -784,7 +792,7 @@ const PostStatusForm = {
|
|||
this.$emit('draft-done')
|
||||
}
|
||||
})
|
||||
} else if (this.newStatus.id) {
|
||||
} else if (this.hasEmptyDraft) {
|
||||
// There is a draft, but there is nothing in it, clear it
|
||||
return this.abandonDraft()
|
||||
.then(() => {
|
||||
|
|
|
|||
|
|
@ -322,6 +322,7 @@
|
|||
trigger="click"
|
||||
placement="bottom"
|
||||
:offset="{ y: 5 }"
|
||||
:trigger-attrs="{ 'aria-label': $t('post_status.more_post_actions') }"
|
||||
>
|
||||
<template #trigger>
|
||||
<FAIcon
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue