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() {
|
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: {
|
||||||
|
|
|
||||||
|
|
@ -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"
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -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,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue