mirror of
https://akkoma.dev/AkkomaGang/akkoma-fe
synced 2025-04-30 19:19:29 +08:00
post_status_form: reset all to defaults on clear
This commit is contained in:
parent
7b8429aa24
commit
65dbac098e
2 changed files with 11 additions and 4 deletions
|
@ -341,17 +341,23 @@ const PostStatusForm = {
|
||||||
this.saveDraft()
|
this.saveDraft()
|
||||||
},
|
},
|
||||||
clearStatus () {
|
clearStatus () {
|
||||||
const newStatus = this.newStatus
|
const config = this.$store.getters.mergedConfig
|
||||||
|
const postLanguage = config.postLanguage || interfaceToISOLanguage(config.interfaceLanguage)
|
||||||
this.newStatus = {
|
this.newStatus = {
|
||||||
status: '',
|
status: '',
|
||||||
spoilerText: '',
|
spoilerText: '',
|
||||||
files: [],
|
files: [],
|
||||||
visibility: newStatus.visibility,
|
nsfw: !!config.sensitiveByDefault,
|
||||||
contentType: newStatus.contentType,
|
visibility: this.suggestedVisibility(),
|
||||||
language: newStatus.language,
|
contentType: config.postContentType,
|
||||||
|
language: postLanguage,
|
||||||
poll: {},
|
poll: {},
|
||||||
mediaDescriptions: {}
|
mediaDescriptions: {}
|
||||||
}
|
}
|
||||||
|
const scopeselector = this.$refs.scopeselector
|
||||||
|
if (scopeselector) {
|
||||||
|
scopeselector.currentScope = this.newStatus.visibility
|
||||||
|
}
|
||||||
this.pollFormVisible = false
|
this.pollFormVisible = false
|
||||||
this.$refs.mediaUpload && this.$refs.mediaUpload.clearFile()
|
this.$refs.mediaUpload && this.$refs.mediaUpload.clearFile()
|
||||||
this.clearPollForm()
|
this.clearPollForm()
|
||||||
|
|
|
@ -195,6 +195,7 @@
|
||||||
:class="{ 'visibility-tray-edit': isEdit }"
|
:class="{ 'visibility-tray-edit': isEdit }"
|
||||||
>
|
>
|
||||||
<scope-selector
|
<scope-selector
|
||||||
|
ref="scopeselector"
|
||||||
v-if="!disableVisibilitySelector"
|
v-if="!disableVisibilitySelector"
|
||||||
:user-default="userDefaultScope"
|
:user-default="userDefaultScope"
|
||||||
:original-scope="copyMessageScope"
|
:original-scope="copyMessageScope"
|
||||||
|
|
Loading…
Reference in a new issue