post_status_form: reset all to defaults on clear

This commit is contained in:
novenary 2024-09-17 10:59:08 +03:00 committed by Jeder
parent 4bcc905731
commit 6669fe0cfa

View file

@ -343,6 +343,7 @@ const PostStatusForm = {
},
clearStatus () {
const config = this.$store.getters.mergedConfig
const postLanguage = config.postLanguage || interfaceToISOLanguage(config.interfaceLanguage)
this.newStatus = {
status: '',
spoilerText: '',
@ -350,11 +351,14 @@ const PostStatusForm = {
nsfw: !!config.sensitiveByDefault,
visibility: this.suggestedVisibility(),
contentType: config.postContentType,
language: this.suggestedLanguage(),
language: postLanguage,
poll: {},
mediaDescriptions: {}
}
this.$refs.scopeselector.currentScope = this.newStatus.visibility
const scopeselector = this.$refs.scopeselector
if (scopeselector) {
scopeselector.currentScope = this.newStatus.visibility
}
this.pollFormVisible = false
this.$refs.mediaUpload && this.$refs.mediaUpload.clearFile()
this.clearPollForm()