fix drafts

This commit is contained in:
Henry Jameson 2026-08-02 22:37:34 +03:00
commit 2eb33e6e42
2 changed files with 13 additions and 4 deletions

View file

@ -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 {}
}

View file

@ -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]