fix drafts
This commit is contained in:
parent
ed8cebf36b
commit
2eb33e6e42
2 changed files with 13 additions and 4 deletions
|
|
@ -42,7 +42,9 @@ const Draft = {
|
||||||
if (this.draft.type === 'edit') {
|
if (this.draft.type === 'edit') {
|
||||||
return { statusId: this.draft.refId }
|
return { statusId: this.draft.refId }
|
||||||
} else if (this.draft.type === 'reply') {
|
} else if (this.draft.type === 'reply') {
|
||||||
return { replyTo: this.draft.refId }
|
return {
|
||||||
|
repliedStatus: this.refStatus
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return {}
|
return {}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -983,8 +983,15 @@ const PostStatusForm = {
|
||||||
saveDraft() {
|
saveDraft() {
|
||||||
if (!this.disableDraft && !this.saveInhibited) {
|
if (!this.disableDraft && !this.saveInhibited) {
|
||||||
if (this.safeToSaveDraft) {
|
if (this.safeToSaveDraft) {
|
||||||
return this.$store
|
return this
|
||||||
.dispatch('addOrSaveDraft', { draft: this.newStatus })
|
.$store
|
||||||
|
.dispatch('addOrSaveDraft', {
|
||||||
|
draft: {
|
||||||
|
type: this.statusType,
|
||||||
|
refId: this.refId,
|
||||||
|
...this.newStatus
|
||||||
|
}
|
||||||
|
})
|
||||||
.then((id) => {
|
.then((id) => {
|
||||||
if (this.newStatus.id !== id) {
|
if (this.newStatus.id !== id) {
|
||||||
this.newStatus.id = id
|
this.newStatus.id = id
|
||||||
|
|
@ -1016,7 +1023,7 @@ const PostStatusForm = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
abandonDraft() {
|
abandonDraft() {
|
||||||
return this.$store.dispatch('abandonDraft', { id: this.newStatus.id })
|
return this.$store.dispatch('abandonDraft', { id: this.draftId })
|
||||||
},
|
},
|
||||||
getDraft() {
|
getDraft() {
|
||||||
const maybeDraft = this.$store.state.drafts.drafts[this.draftId]
|
const maybeDraft = this.$store.state.drafts.drafts[this.draftId]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue