From 7f2402416b5cdd1183bb8f1380eba93036de7a83 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Mon, 14 Nov 2022 20:54:09 -0800 Subject: [PATCH 01/11] properly define page metadata in DM --- package.json | 2 +- .../client/src/components/MkChatPreview.vue | 2 +- .../src/pages/messaging/messaging-room.vue | 20 +++++++++++-------- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 87e4b481d0..6621ea6ecb 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/packages/client/src/components/MkChatPreview.vue b/packages/client/src/components/MkChatPreview.vue index 4d604e2e86..ff49399059 100644 --- a/packages/client/src/components/MkChatPreview.vue +++ b/packages/client/src/components/MkChatPreview.vue @@ -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 diff --git a/packages/client/src/pages/messaging/messaging-room.vue b/packages/client/src/pages/messaging/messaging-room.vue index d3ce5886d9..2dbfb5b869 100644 --- a/packages/client/src/pages/messaging/messaging-room.vue +++ b/packages/client/src/pages/messaging/messaging-room.vue @@ -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));