proper disable
This commit is contained in:
parent
f653ac4a62
commit
acbb53d6a4
5 changed files with 47 additions and 7 deletions
|
|
@ -352,6 +352,12 @@ const PostStatusForm = {
|
|||
return this.$t('post_status.auto_save_nothing_new')
|
||||
}
|
||||
},
|
||||
safeToSaveDraft () {
|
||||
return this.newStatus.status ||
|
||||
this.newStatus.spoilerText ||
|
||||
this.newStatus.files?.length ||
|
||||
this.newStatus.hasPoll
|
||||
},
|
||||
...mapGetters(['mergedConfig']),
|
||||
...mapState({
|
||||
mobileLayout: state => state.interface.mobileLayout
|
||||
|
|
@ -747,9 +753,7 @@ const PostStatusForm = {
|
|||
saveDraft () {
|
||||
if (!this.disableDraft &&
|
||||
!this.saveInhibited) {
|
||||
if (this.newStatus.status ||
|
||||
this.newStatus.files?.length ||
|
||||
this.newStatus.hasPoll) {
|
||||
if (this.safeToSaveDraft) {
|
||||
return this.$store.dispatch('addOrSaveDraft', { draft: this.newStatus })
|
||||
.then(id => {
|
||||
if (this.newStatus.id !== id) {
|
||||
|
|
|
|||
|
|
@ -339,6 +339,8 @@
|
|||
v-if="!disableDraft"
|
||||
class="menu-item dropdown-item dropdown-item-icon"
|
||||
role="menu"
|
||||
:disabled="!safeToSaveDraft"
|
||||
:class="{ disabled: !safeToSaveDraft }"
|
||||
@click.prevent="saveDraft"
|
||||
@click="close"
|
||||
>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue