properly define page metadata in DM
This commit is contained in:
parent
aaa8c8fec7
commit
7f2402416b
3 changed files with 14 additions and 10 deletions
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "calckey",
|
||||
"version": "12.119.0-calc.13.3",
|
||||
"version": "12.119.0-calc.13.4",
|
||||
"codename": "aqua",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
tabindex="-1"
|
||||
:class="{
|
||||
isMe: isMe(message),
|
||||
isRead: message.groupId ? message.reads.includes($i.id) : message.isRead,
|
||||
isRead: message.groupId ? message.reads.includes($i?.id) : message.isRead,
|
||||
}"
|
||||
:to="
|
||||
message.groupId
|
||||
|
|
|
@ -275,6 +275,18 @@ function onVisibilitychange() {
|
|||
|
||||
onMounted(() => {
|
||||
fetch();
|
||||
if (group != null) {
|
||||
definePageMetadata(computed(() => ({
|
||||
title: group.name,
|
||||
icon: 'ph-chats-teardrop-bold ph-lg',
|
||||
})));
|
||||
}
|
||||
else {
|
||||
definePageMetadata(computed(() => ({
|
||||
title: user.name,
|
||||
icon: 'ph-chats-teardrop-bold ph-lg',
|
||||
})));
|
||||
}
|
||||
});
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
|
@ -282,14 +294,6 @@ onBeforeUnmount(() => {
|
|||
document.removeEventListener('visibilitychange', onVisibilitychange);
|
||||
if (scrollRemove) scrollRemove();
|
||||
});
|
||||
|
||||
definePageMetadata(computed(() => !fetching ? user ? {
|
||||
userName: user,
|
||||
avatar: user,
|
||||
} : {
|
||||
title: group?.name,
|
||||
icon: 'ph-users-three-bold ph-lg',
|
||||
} : null));
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
Loading…
Reference in a new issue