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 () { clearStatus () {
const config = this.$store.getters.mergedConfig const config = this.$store.getters.mergedConfig
const postLanguage = config.postLanguage || interfaceToISOLanguage(config.interfaceLanguage)
this.newStatus = { this.newStatus = {
status: '', status: '',
spoilerText: '', spoilerText: '',
@ -350,11 +351,14 @@ const PostStatusForm = {
nsfw: !!config.sensitiveByDefault, nsfw: !!config.sensitiveByDefault,
visibility: this.suggestedVisibility(), visibility: this.suggestedVisibility(),
contentType: config.postContentType, contentType: config.postContentType,
language: this.suggestedLanguage(), language: postLanguage,
poll: {}, poll: {},
mediaDescriptions: {} mediaDescriptions: {}
} }
this.$refs.scopeselector.currentScope = this.newStatus.visibility 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()