post_status_form: reset all to defaults on clear

This commit is contained in:
novenary 2024-09-17 10:59:08 +03:00
parent 7b8429aa24
commit 65dbac098e
2 changed files with 11 additions and 4 deletions

View file

@ -341,17 +341,23 @@ const PostStatusForm = {
this.saveDraft()
},
clearStatus () {
const newStatus = this.newStatus
const config = this.$store.getters.mergedConfig
const postLanguage = config.postLanguage || interfaceToISOLanguage(config.interfaceLanguage)
this.newStatus = {
status: '',
spoilerText: '',
files: [],
visibility: newStatus.visibility,
contentType: newStatus.contentType,
language: newStatus.language,
nsfw: !!config.sensitiveByDefault,
visibility: this.suggestedVisibility(),
contentType: config.postContentType,
language: postLanguage,
poll: {},
mediaDescriptions: {}
}
const scopeselector = this.$refs.scopeselector
if (scopeselector) {
scopeselector.currentScope = this.newStatus.visibility
}
this.pollFormVisible = false
this.$refs.mediaUpload && this.$refs.mediaUpload.clearFile()
this.clearPollForm()

View file

@ -195,6 +195,7 @@
:class="{ 'visibility-tray-edit': isEdit }"
>
<scope-selector
ref="scopeselector"
v-if="!disableVisibilitySelector"
:user-default="userDefaultScope"
:original-scope="copyMessageScope"