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') {
|
||||
return { statusId: this.draft.refId }
|
||||
} else if (this.draft.type === 'reply') {
|
||||
return { replyTo: this.draft.refId }
|
||||
return {
|
||||
repliedStatus: this.refStatus
|
||||
}
|
||||
} else {
|
||||
return {}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -983,8 +983,15 @@ const PostStatusForm = {
|
|||
saveDraft() {
|
||||
if (!this.disableDraft && !this.saveInhibited) {
|
||||
if (this.safeToSaveDraft) {
|
||||
return this.$store
|
||||
.dispatch('addOrSaveDraft', { draft: this.newStatus })
|
||||
return this
|
||||
.$store
|
||||
.dispatch('addOrSaveDraft', {
|
||||
draft: {
|
||||
type: this.statusType,
|
||||
refId: this.refId,
|
||||
...this.newStatus
|
||||
}
|
||||
})
|
||||
.then((id) => {
|
||||
if (this.newStatus.id !== id) {
|
||||
this.newStatus.id = id
|
||||
|
|
@ -1016,7 +1023,7 @@ const PostStatusForm = {
|
|||
}
|
||||
},
|
||||
abandonDraft() {
|
||||
return this.$store.dispatch('abandonDraft', { id: this.newStatus.id })
|
||||
return this.$store.dispatch('abandonDraft', { id: this.draftId })
|
||||
},
|
||||
getDraft() {
|
||||
const maybeDraft = this.$store.state.drafts.drafts[this.draftId]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue