From 38d7f5b3807e61684aa3a0e2e3c606926c47cac5 Mon Sep 17 00:00:00 2001 From: usman-ghani564 Date: Wed, 12 Jun 2024 19:08:52 +0500 Subject: [PATCH] fix: null checks for title --- src/pages/ReportAvatar.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/ReportAvatar.tsx b/src/pages/ReportAvatar.tsx index 444d27d38caf..7d9321b95281 100644 --- a/src/pages/ReportAvatar.tsx +++ b/src/pages/ReportAvatar.tsx @@ -37,7 +37,7 @@ function ReportAvatar({report = {} as Report, policies, isLoadingApp = true, rou fileName = groupChatDraft?.originalFileName ?? undefined; // When user enters custom group name, it typically stored in groupChatDraft.reportName // If that is null then we will use ReportUtils.getGroupChatName to get the name - title = groupChatDraft?.reportName ?? ReportUtils.getGroupChatName(groupChatDraft?.participants.map((participant) => participant.accountID) ?? []); + title = groupChatDraft?.reportName || ReportUtils.getGroupChatName(groupChatDraft?.participants.map((participant) => participant.accountID) ?? [], true); shouldShowNotFoundPage = !isLoadingApp && !groupChatDraft; } else { avatarURL = policy ? ReportUtils.getWorkspaceAvatar(report) : report?.avatarUrl;