mirror of
https://github.com/Troplo/Colubrina.git
synced 2024-11-22 19:27:55 +11:00
Update CommunicationsChat.vue
This commit is contained in:
parent
89cee44fda
commit
d80c7a76e6
1 changed files with 27 additions and 0 deletions
|
@ -812,6 +812,33 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getDirectRecipient(item) {
|
||||||
|
let user = item.chat.users.find(
|
||||||
|
(user) => user.id !== this.$store.state.user.id
|
||||||
|
)
|
||||||
|
if (user) {
|
||||||
|
if (user.nickname?.nickname) {
|
||||||
|
user.name = user.nickname.nickname
|
||||||
|
} else {
|
||||||
|
user.name = user.username
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
...user,
|
||||||
|
type: item.chat.type
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
let user = item.chat.users[0]
|
||||||
|
if (user.nickname?.nickname) {
|
||||||
|
user.name = user.nickname.nickname
|
||||||
|
} else {
|
||||||
|
user.name = user.username
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
...user,
|
||||||
|
type: item.chat.type
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
async scrollEvent(e) {
|
async scrollEvent(e) {
|
||||||
this.avoidAutoScroll =
|
this.avoidAutoScroll =
|
||||||
e.target.scrollTop + e.target.offsetHeight !== e.target.scrollHeight
|
e.target.scrollTop + e.target.offsetHeight !== e.target.scrollHeight
|
||||||
|
|
Loading…
Reference in a new issue