properly define page metadata in DM

This commit is contained in:
ThatOneCalculator 2022-11-14 20:54:09 -08:00
parent aaa8c8fec7
commit 7f2402416b
3 changed files with 14 additions and 10 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "calckey", "name": "calckey",
"version": "12.119.0-calc.13.3", "version": "12.119.0-calc.13.4",
"codename": "aqua", "codename": "aqua",
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -4,7 +4,7 @@
tabindex="-1" tabindex="-1"
:class="{ :class="{
isMe: isMe(message), isMe: isMe(message),
isRead: message.groupId ? message.reads.includes($i.id) : message.isRead, isRead: message.groupId ? message.reads.includes($i?.id) : message.isRead,
}" }"
:to=" :to="
message.groupId message.groupId

View File

@ -275,6 +275,18 @@ function onVisibilitychange() {
onMounted(() => { onMounted(() => {
fetch(); 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(() => { onBeforeUnmount(() => {
@ -282,14 +294,6 @@ onBeforeUnmount(() => {
document.removeEventListener('visibilitychange', onVisibilitychange); document.removeEventListener('visibilitychange', onVisibilitychange);
if (scrollRemove) scrollRemove(); if (scrollRemove) scrollRemove();
}); });
definePageMetadata(computed(() => !fetching ? user ? {
userName: user,
avatar: user,
} : {
title: group?.name,
icon: 'ph-users-three-bold ph-lg',
} : null));
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>