Skip to content

Commit

Permalink
fix: update chatprevie badge conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
corlard3y committed May 29, 2024
1 parent 19f3f6b commit 8c45b54
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ export const ChatPreview: React.FC<IChatPreviewProps> = (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<HTMLDivElement>(null);
Expand Down Expand Up @@ -198,8 +199,8 @@ export const ChatPreview: React.FC<IChatPreviewProps> = (options: IChatPreviewPr
)}
</Message>

{((hasBadgeCount || isBot) && !options?.selected) && <Badge theme={theme}>{options.badge?.count}</Badge>}
</Section>
{hasBadgeCount && !(isBot || (isSelected && hasBadgeCount)) && <Badge theme={theme}>{options.badge?.count}</Badge>}
</Section>
</Section>
</Button>
</ChatPreviewContainer>
Expand Down
2 changes: 1 addition & 1 deletion packages/uiweb/src/lib/config/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
export const pushBotAddress = "eip155:0x99A08ac6254dcf7ccc37CeC662aeba8eFA666666";

0 comments on commit 8c45b54

Please sign in to comment.