From 512b9a25d7f49a12ee5bf44ca5f5dd6224805c8e Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Mon, 14 Nov 2022 20:58:23 -0800 Subject: [PATCH] refactor --- .../src/pages/messaging/messaging-room.vue | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/packages/client/src/pages/messaging/messaging-room.vue b/packages/client/src/pages/messaging/messaging-room.vue index 2dbfb5b86..8cf0104c0 100644 --- a/packages/client/src/pages/messaging/messaging-room.vue +++ b/packages/client/src/pages/messaging/messaging-room.vue @@ -275,18 +275,10 @@ 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', - }))); - } + definePageMetadata(computed(() => ({ + title: group != null ? group.name : user?.name, + icon: 'ph-chats-teardrop-bold ph-lg', + }))); }); onBeforeUnmount(() => {