This commit is contained in:
Henry Jameson 2026-09-02 19:14:48 +03:00
commit 53a0ab9af2
3 changed files with 8 additions and 18 deletions

View file

@ -34,9 +34,7 @@ const Draft = {
}, },
data() { data() {
return { return {
referenceDraft: cloneDeep(this.draft),
editing: false, editing: false,
showingForm: false,
showingConfirmDialog: false, showingConfirmDialog: false,
} }
}, },
@ -52,14 +50,6 @@ const Draft = {
return {} return {}
} }
}, },
safeToSave() {
return Boolean(
this.draft.status ||
this.draft.files?.length ||
this.draft.hasPoll ||
this.draft.hasQuote
)
},
postStatusFormProps() { postStatusFormProps() {
return { return {
draftId: this.draft.id, draftId: this.draft.id,
@ -71,15 +61,12 @@ const Draft = {
? useStatusesStore().allStatuses.get(this.draft.refId) ? useStatusesStore().allStatuses.get(this.draft.refId)
: undefined : undefined
}, },
localCollapseSubjectDefault() {
return useMergedConfigStore().mergedConfig.collapseMessageWithSubject
},
}, },
watch: { watch: {
editing(newVal) { editing(newVal) {
this.showingForm = true
if (newVal) return if (newVal) return
this.showingForm = false // (Post|Edit)StatusForm handles draft saving
this.$refs.form.saveDraft()
}, },
}, },
methods: { methods: {

View file

@ -64,16 +64,16 @@
</div> </div>
</div> </div>
</div> </div>
<div v-if="showingForm"> <div v-if="editing">
<PostStatusForm <PostStatusForm
v-if="draft.type !== 'edit'" v-if="draft.type !== 'edit'"
ref="postStatusForm" ref="form"
:hide-draft="true" :hide-draft="true"
v-bind="postStatusFormProps" v-bind="postStatusFormProps"
/> />
<EditStatusForm <EditStatusForm
v-else v-else
ref="editStatusForm" ref="form"
:hide-draft="true" :hide-draft="true"
:params="postStatusFormProps" :params="postStatusFormProps"
/> />

View file

@ -15,6 +15,9 @@ const EditStatusForm = {
requestClose() { requestClose() {
this.$refs.postStatusForm.requestClose() this.$refs.postStatusForm.requestClose()
}, },
saveDraft() {
this.$refs.postStatusForm.saveDraft()
},
doEditStatus({ status, spoilerText, sensitive, media, contentType, poll }) { doEditStatus({ status, spoilerText, sensitive, media, contentType, poll }) {
const params = { const params = {
statusId: this.params.statusId, statusId: this.params.statusId,