mirror of
https://akkoma.dev/AkkomaGang/akkoma-fe
synced 2025-05-11 06:59:14 +08:00
Move scope logic to function
This commit is contained in:
parent
7af3ef4913
commit
cf8324c6c5
1 changed files with 14 additions and 9 deletions
|
@ -112,19 +112,11 @@ const PostStatusForm = {
|
||||||
const preset = this.$route.query.message
|
const preset = this.$route.query.message
|
||||||
let statusText = preset || ''
|
let statusText = preset || ''
|
||||||
|
|
||||||
const { scopeCopy } = this.$store.getters.mergedConfig
|
|
||||||
|
|
||||||
if (this.replyTo) {
|
if (this.replyTo) {
|
||||||
const currentUser = this.$store.state.users.currentUser
|
const currentUser = this.$store.state.users.currentUser
|
||||||
statusText = buildMentionsString({ user: this.repliedUser, attentions: this.attentions }, currentUser)
|
statusText = buildMentionsString({ user: this.repliedUser, attentions: this.attentions }, currentUser)
|
||||||
}
|
}
|
||||||
|
|
||||||
const scope = (this.copyMessageScope && (
|
|
||||||
(this.copyMessageScope !== 'public' && this.$store.state.users.currentUser.default_scope !== 'private' && scopeCopy) ||
|
|
||||||
this.copyMessageScope === 'direct'))
|
|
||||||
? this.copyMessageScope
|
|
||||||
: this.$store.state.users.currentUser.default_scope
|
|
||||||
|
|
||||||
const { postContentType: contentType, sensitiveByDefault, sensitiveIfSubject } = this.$store.getters.mergedConfig
|
const { postContentType: contentType, sensitiveByDefault, sensitiveIfSubject } = this.$store.getters.mergedConfig
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
@ -141,7 +133,7 @@ const PostStatusForm = {
|
||||||
files: [],
|
files: [],
|
||||||
poll: {},
|
poll: {},
|
||||||
mediaDescriptions: {},
|
mediaDescriptions: {},
|
||||||
visibility: scope,
|
visibility: this.suggestedVisibility(),
|
||||||
contentType
|
contentType
|
||||||
},
|
},
|
||||||
caret: 0,
|
caret: 0,
|
||||||
|
@ -616,6 +608,19 @@ const PostStatusForm = {
|
||||||
},
|
},
|
||||||
openProfileTab () {
|
openProfileTab () {
|
||||||
this.$store.dispatch('openSettingsModalTab', 'profile')
|
this.$store.dispatch('openSettingsModalTab', 'profile')
|
||||||
|
},
|
||||||
|
suggestedVisibility () {
|
||||||
|
if (this.copyMessageScope) {
|
||||||
|
if (this.copyMessageScope === 'direct') {
|
||||||
|
return this.copyMessageScope
|
||||||
|
}
|
||||||
|
if (this.$store.getters.mergedConfig.scopeCopy) {
|
||||||
|
if (this.copyMessageScope !== 'public' && this.$store.state.users.currentUser.default_scope !== 'private') {
|
||||||
|
return this.copyMessageScope
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return this.$store.state.users.currentUser.default_scope
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue