From 8c45b548a6e0b7e0bed8e370aec0e9a675083ff8 Mon Sep 17 00:00:00 2001 From: corlard3y Date: Wed, 29 May 2024 06:06:49 +0100 Subject: [PATCH] fix: update chatprevie badge conditions --- .../src/lib/components/chat/ChatPreview/ChatPreview.tsx | 7 ++++--- packages/uiweb/src/lib/config/constants.ts | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/uiweb/src/lib/components/chat/ChatPreview/ChatPreview.tsx b/packages/uiweb/src/lib/components/chat/ChatPreview/ChatPreview.tsx index 1c3dbd8f4..5985e5d37 100644 --- a/packages/uiweb/src/lib/components/chat/ChatPreview/ChatPreview.tsx +++ b/packages/uiweb/src/lib/components/chat/ChatPreview/ChatPreview.tsx @@ -52,7 +52,8 @@ export const ChatPreview: React.FC = (options: IChatPreviewPr }, []); const hasBadgeCount = !!options?.badge?.count; - const isBot = options?.chatPreviewPayload?.chatId === pushBotAddress; + const isSelected = options?.selected; + const isBot = options?.chatPreviewPayload?.chatParticipant === "PushBot" || options?.chatPreviewPayload?.chatParticipant === pushBotAddress; // For blockie if icon is missing const blockieContainerRef = useRef(null); @@ -198,8 +199,8 @@ export const ChatPreview: React.FC = (options: IChatPreviewPr )} - {((hasBadgeCount || isBot) && !options?.selected) && {options.badge?.count}} - + {hasBadgeCount && !(isBot || (isSelected && hasBadgeCount)) && {options.badge?.count}} + diff --git a/packages/uiweb/src/lib/config/constants.ts b/packages/uiweb/src/lib/config/constants.ts index 5c1343597..0f37e1fd6 100644 --- a/packages/uiweb/src/lib/config/constants.ts +++ b/packages/uiweb/src/lib/config/constants.ts @@ -158,4 +158,4 @@ export const LIVEKIT_TOKEN_GENERATOR_SERVER_URL = 'https://ms-lk-server.onrender.com'; export const GUEST_MODE_ACCOUNT = '0x0000000000000000000000000000000000000001'; -export const pushBotAddress = "0x99A08ac6254dcf7ccc37CeC662aeba8eFA666666"; \ No newline at end of file +export const pushBotAddress = "eip155:0x99A08ac6254dcf7ccc37CeC662aeba8eFA666666"; \ No newline at end of file