cleanup
This commit is contained in:
parent
266e711786
commit
53a0ab9af2
3 changed files with 8 additions and 18 deletions
|
|
@ -34,9 +34,7 @@ const Draft = {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
referenceDraft: cloneDeep(this.draft),
|
||||
editing: false,
|
||||
showingForm: false,
|
||||
showingConfirmDialog: false,
|
||||
}
|
||||
},
|
||||
|
|
@ -52,14 +50,6 @@ const Draft = {
|
|||
return {}
|
||||
}
|
||||
},
|
||||
safeToSave() {
|
||||
return Boolean(
|
||||
this.draft.status ||
|
||||
this.draft.files?.length ||
|
||||
this.draft.hasPoll ||
|
||||
this.draft.hasQuote
|
||||
)
|
||||
},
|
||||
postStatusFormProps() {
|
||||
return {
|
||||
draftId: this.draft.id,
|
||||
|
|
@ -71,15 +61,12 @@ const Draft = {
|
|||
? useStatusesStore().allStatuses.get(this.draft.refId)
|
||||
: undefined
|
||||
},
|
||||
localCollapseSubjectDefault() {
|
||||
return useMergedConfigStore().mergedConfig.collapseMessageWithSubject
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
editing(newVal) {
|
||||
this.showingForm = true
|
||||
if (newVal) return
|
||||
this.showingForm = false
|
||||
// (Post|Edit)StatusForm handles draft saving
|
||||
this.$refs.form.saveDraft()
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
|
|
|||
|
|
@ -64,16 +64,16 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="showingForm">
|
||||
<div v-if="editing">
|
||||
<PostStatusForm
|
||||
v-if="draft.type !== 'edit'"
|
||||
ref="postStatusForm"
|
||||
ref="form"
|
||||
:hide-draft="true"
|
||||
v-bind="postStatusFormProps"
|
||||
/>
|
||||
<EditStatusForm
|
||||
v-else
|
||||
ref="editStatusForm"
|
||||
ref="form"
|
||||
:hide-draft="true"
|
||||
:params="postStatusFormProps"
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -15,6 +15,9 @@ const EditStatusForm = {
|
|||
requestClose() {
|
||||
this.$refs.postStatusForm.requestClose()
|
||||
},
|
||||
saveDraft() {
|
||||
this.$refs.postStatusForm.saveDraft()
|
||||
},
|
||||
doEditStatus({ status, spoilerText, sensitive, media, contentType, poll }) {
|
||||
const params = {
|
||||
statusId: this.params.statusId,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue