Merge branch 'chat-refactor' into shigusegubu-themes3
This commit is contained in:
commit
3973105691
3 changed files with 16 additions and 14 deletions
|
|
@ -76,7 +76,9 @@ const ChatMessage = {
|
||||||
return !!this.message.user
|
return !!this.message.user
|
||||||
},
|
},
|
||||||
author() {
|
author() {
|
||||||
const accountId = this.isStatus ? this.message.user.id : this.message.account_id
|
const accountId = this.isStatus
|
||||||
|
? this.message.user.id
|
||||||
|
: this.message.account_id
|
||||||
|
|
||||||
return this.$store.getters.findUser(accountId)
|
return this.$store.getters.findUser(accountId)
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@
|
||||||
@pause="$emit('mediapause', attachment.id)"
|
@pause="$emit('mediapause', attachment.id)"
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
v-if="draft.poll.options"
|
v-if="draft.poll?.options"
|
||||||
class="poll-indicator-container"
|
class="poll-indicator-container"
|
||||||
:title="$t('drafts.poll_tooltip')"
|
:title="$t('drafts.poll_tooltip')"
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -266,9 +266,9 @@ const PostStatusForm = {
|
||||||
mentionsString() {
|
mentionsString() {
|
||||||
if (this.statusType !== 'reply' && this.statusType !== 'mention')
|
if (this.statusType !== 'reply' && this.statusType !== 'mention')
|
||||||
return ''
|
return ''
|
||||||
let allAttentions = [...(this.attentions || [])]
|
let allAttentions = [...(this.newStatus.mentions || [])]
|
||||||
|
|
||||||
allAttentions.unshift(this.repliedUser)
|
if (this.repliedUser) allAttentions.unshift(this.repliedUser)
|
||||||
|
|
||||||
allAttentions = uniqBy(allAttentions, 'id')
|
allAttentions = uniqBy(allAttentions, 'id')
|
||||||
allAttentions = reject(allAttentions, { id: this.currentUser.id })
|
allAttentions = reject(allAttentions, { id: this.currentUser.id })
|
||||||
|
|
@ -303,12 +303,11 @@ const PostStatusForm = {
|
||||||
|
|
||||||
if (this.mentionsLine) {
|
if (this.mentionsLine) {
|
||||||
defaultNewStatus.status = statusText
|
defaultNewStatus.status = statusText
|
||||||
defaultNewStatus.mentions = this.mentionsString.trim()
|
|
||||||
} else {
|
} else {
|
||||||
defaultNewStatus.status = this.mentionsString + statusText
|
defaultNewStatus.status = this.mentionsString + statusText
|
||||||
defaultNewStatus.mentions = ''
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
defaultNewStatus.mentions = this.attentions
|
||||||
defaultNewStatus.spoilerText = this.repliedSubjectString ?? ''
|
defaultNewStatus.spoilerText = this.repliedSubjectString ?? ''
|
||||||
defaultNewStatus.nsfw = this.userDefaultSensitive
|
defaultNewStatus.nsfw = this.userDefaultSensitive
|
||||||
defaultNewStatus.visibility = scope
|
defaultNewStatus.visibility = scope
|
||||||
|
|
@ -591,7 +590,8 @@ const PostStatusForm = {
|
||||||
// Composing
|
// Composing
|
||||||
onMentionsLineUpdate(e) {
|
onMentionsLineUpdate(e) {
|
||||||
if (this.mentionsLineReadOnly) return
|
if (this.mentionsLineReadOnly) return
|
||||||
this.newStatus.mentionsLine = e
|
// TODO
|
||||||
|
//this.newStatus.mentions = e
|
||||||
},
|
},
|
||||||
changeVis(visibility) {
|
changeVis(visibility) {
|
||||||
this.newStatus.visibility = visibility
|
this.newStatus.visibility = visibility
|
||||||
|
|
@ -599,13 +599,13 @@ const PostStatusForm = {
|
||||||
clearStatus() {
|
clearStatus() {
|
||||||
this.saveInhibited = true
|
this.saveInhibited = true
|
||||||
this.newStatus.status = ''
|
this.newStatus.status = ''
|
||||||
;(this.newStatus.mentionsLine = ''),
|
this.newStatus.mentions = null
|
||||||
(this.newStatus.spoilerText = ''),
|
this.newStatus.spoilerText = ''
|
||||||
(this.newStatus.files = []),
|
this.newStatus.files = []
|
||||||
(this.newStatus.poll = null),
|
this.newStatus.poll = null
|
||||||
(this.newStatus.quote = null),
|
this.newStatus.quote = null
|
||||||
(this.newStatus.mediaDescriptions = {}),
|
this.newStatus.mediaDescriptions = {}
|
||||||
this.$refs.mediaUpload && this.$refs.mediaUpload.clearFile()
|
this.$refs.mediaUpload && this.$refs.mediaUpload.clearFile()
|
||||||
this.clearQuoteForm()
|
this.clearQuoteForm()
|
||||||
if (this.preserveFocus) {
|
if (this.preserveFocus) {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue