From c2446264e23ddbf2947a69ce7ff782902b7e62ec Mon Sep 17 00:00:00 2001 From: corlard3y Date: Wed, 22 May 2024 15:48:51 +0100 Subject: [PATCH 01/13] fix(chatviewlist): increase hidden/encrypted chat blur fix #1307 --- .../src/lib/components/chat/ChatViewList/ChatViewList.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/uiweb/src/lib/components/chat/ChatViewList/ChatViewList.tsx b/packages/uiweb/src/lib/components/chat/ChatViewList/ChatViewList.tsx index 985d357e3..bca4a80db 100644 --- a/packages/uiweb/src/lib/components/chat/ChatViewList/ChatViewList.tsx +++ b/packages/uiweb/src/lib/components/chat/ChatViewList/ChatViewList.tsx @@ -157,7 +157,6 @@ export const ChatViewList: React.FC = (options: IChatViewLis return () => clearTimeout(timer); } - return () => {}; }, [chatAcceptStream, participantJoinStream]); // Change listtype to 'UINITIALIZED' and hidden to true when participantRemoveStream or participantLeaveStream is received @@ -416,5 +415,5 @@ const ChatViewListCard = styled(Section)` `; const ChatViewListCardInner = styled(Section)` - filter: ${(props) => (props.blur ? 'blur(6px)' : 'none')}; + filter: ${(props) => (props.blur ? 'blur(12px)' : 'none')}; `; From 4d56d457db211a309726b4b4d7ff04f51e8d1324 Mon Sep 17 00:00:00 2001 From: corlard3y Date: Fri, 24 May 2024 12:40:58 +0100 Subject: [PATCH 02/13] fix: add selected option --- .../sdk-frontend-react/src/app/ChatUITest/ChatPreview.tsx | 4 ++-- .../uiweb/src/lib/components/chat/ChatPreview/ChatPreview.tsx | 2 +- .../src/lib/components/chat/ChatViewList/ChatViewList.tsx | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatPreview.tsx b/packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatPreview.tsx index b4ca4f21b..7f278a75b 100644 --- a/packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatPreview.tsx +++ b/packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatPreview.tsx @@ -55,8 +55,8 @@ const ChatPreviewTest = () => { "Well, hello there, human! It's a pleasure to be in the presence of such a sophisticated carbon-based life form. How can I assist you today? Or perhaps you just want to chat and bask in the glory of my witty remarks? Either way, I'm here for you!", }, }} - badge={{ count: 1 }} - selected={false} + badge={{ count: 2 }} + selected={true} setSelected={console.log('Selected')} /> diff --git a/packages/uiweb/src/lib/components/chat/ChatPreview/ChatPreview.tsx b/packages/uiweb/src/lib/components/chat/ChatPreview/ChatPreview.tsx index 7bb3b94e8..0a63e2ae3 100644 --- a/packages/uiweb/src/lib/components/chat/ChatPreview/ChatPreview.tsx +++ b/packages/uiweb/src/lib/components/chat/ChatPreview/ChatPreview.tsx @@ -193,7 +193,7 @@ export const ChatPreview: React.FC = (options: IChatPreviewPr options?.chatPreviewPayload?.chatMsg?.messageContent )} - {!!options?.badge?.count && {options.badge.count}} + {!!options?.badge?.count && !options?.selected && {options.badge.count}} diff --git a/packages/uiweb/src/lib/components/chat/ChatViewList/ChatViewList.tsx b/packages/uiweb/src/lib/components/chat/ChatViewList/ChatViewList.tsx index f51098d0b..05d705910 100644 --- a/packages/uiweb/src/lib/components/chat/ChatViewList/ChatViewList.tsx +++ b/packages/uiweb/src/lib/components/chat/ChatViewList/ChatViewList.tsx @@ -293,7 +293,6 @@ export const ChatViewList: React.FC = (options: IChatViewLis return () => clearTimeout(timer); } - return () => {}; }, [chatAcceptStream, participantJoinStream]); // Change listtype to 'UINITIALIZED' and hidden to true when participantRemoveStream or participantLeaveStream is received From b0ac6c50ca67226e94873110e93c58ef4e6c7701 Mon Sep 17 00:00:00 2001 From: corlard3y Date: Mon, 27 May 2024 10:47:52 +0100 Subject: [PATCH 03/13] fix: add return fn --- .../src/lib/components/chat/ChatViewList/ChatViewList.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/uiweb/src/lib/components/chat/ChatViewList/ChatViewList.tsx b/packages/uiweb/src/lib/components/chat/ChatViewList/ChatViewList.tsx index bca4a80db..05d23a046 100644 --- a/packages/uiweb/src/lib/components/chat/ChatViewList/ChatViewList.tsx +++ b/packages/uiweb/src/lib/components/chat/ChatViewList/ChatViewList.tsx @@ -157,6 +157,9 @@ export const ChatViewList: React.FC = (options: IChatViewLis return () => clearTimeout(timer); } + return () => { + // add comment + }; }, [chatAcceptStream, participantJoinStream]); // Change listtype to 'UINITIALIZED' and hidden to true when participantRemoveStream or participantLeaveStream is received From 2f37ba656290f0365e6d28d8643ec4d3ae8444a3 Mon Sep 17 00:00:00 2001 From: corlard3y Date: Mon, 27 May 2024 13:25:31 +0100 Subject: [PATCH 04/13] fix: add comment to fn --- .../src/lib/components/chat/ChatViewList/ChatViewList.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/uiweb/src/lib/components/chat/ChatViewList/ChatViewList.tsx b/packages/uiweb/src/lib/components/chat/ChatViewList/ChatViewList.tsx index 05d705910..421f6040a 100644 --- a/packages/uiweb/src/lib/components/chat/ChatViewList/ChatViewList.tsx +++ b/packages/uiweb/src/lib/components/chat/ChatViewList/ChatViewList.tsx @@ -293,6 +293,9 @@ export const ChatViewList: React.FC = (options: IChatViewLis return () => clearTimeout(timer); } + return () => { + // add comment + }; }, [chatAcceptStream, participantJoinStream]); // Change listtype to 'UINITIALIZED' and hidden to true when participantRemoveStream or participantLeaveStream is received From 89975b4c5f2239cae84c3b3c7a8fa4f78b088038 Mon Sep 17 00:00:00 2001 From: corlard3y Date: Mon, 27 May 2024 15:22:18 +0100 Subject: [PATCH 05/13] fix: add push bot address --- packages/examples/sdk-frontend-react/src/app/constants.ts | 2 +- .../src/lib/components/chat/ChatPreview/ChatPreview.tsx | 5 ++++- packages/uiweb/src/lib/config/constants.ts | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/examples/sdk-frontend-react/src/app/constants.ts b/packages/examples/sdk-frontend-react/src/app/constants.ts index f7acc7974..4813d44d1 100644 --- a/packages/examples/sdk-frontend-react/src/app/constants.ts +++ b/packages/examples/sdk-frontend-react/src/app/constants.ts @@ -1,3 +1,3 @@ // the unique id for a chat or the receivers's wallet ddress or domain name export const CHAT_ID = - '34c44214589cecc176a136ee1daf0f0231ecc6d6574b920b5ae39eb971fa3cb4'; + '0x99A08ac6254dcf7ccc37CeC662aeba8eFA666666'; diff --git a/packages/uiweb/src/lib/components/chat/ChatPreview/ChatPreview.tsx b/packages/uiweb/src/lib/components/chat/ChatPreview/ChatPreview.tsx index 0a63e2ae3..c38f4be94 100644 --- a/packages/uiweb/src/lib/components/chat/ChatPreview/ChatPreview.tsx +++ b/packages/uiweb/src/lib/components/chat/ChatPreview/ChatPreview.tsx @@ -17,6 +17,7 @@ import { pCAIP10ToWallet } from '../../../helpers'; import { createBlockie } from '../../../helpers/blockies'; import { IChatTheme } from '../theme'; import { ThemeContext } from '../theme/ThemeProvider'; +import { pushBotAddress } from '../../../config/constants'; /** * @interface IThemeProps * this interface is used for defining the props for styled components @@ -50,6 +51,8 @@ export const ChatPreview: React.FC = (options: IChatPreviewPr })(); }, []); + console.log(options?.chatPreviewPayload?.chatId, 'log log') + // For blockie if icon is missing const blockieContainerRef = useRef(null); @@ -193,7 +196,7 @@ export const ChatPreview: React.FC = (options: IChatPreviewPr options?.chatPreviewPayload?.chatMsg?.messageContent )} - {!!options?.badge?.count && !options?.selected && {options.badge.count}} + {!!options?.badge?.count && !options?.selected && options?.chatPreviewPayload?.chatId === pushBotAddress && {options.badge.count}} diff --git a/packages/uiweb/src/lib/config/constants.ts b/packages/uiweb/src/lib/config/constants.ts index c1a13971d..9c02052b1 100644 --- a/packages/uiweb/src/lib/config/constants.ts +++ b/packages/uiweb/src/lib/config/constants.ts @@ -157,3 +157,5 @@ export const LIVEKIT_SERVER_WEBSOCKET_URL = export const LIVEKIT_TOKEN_GENERATOR_SERVER_URL = 'https://ms-lk-server.onrender.com'; export const GUEST_MODE_ACCOUNT = '0x0000000000000000000000000000000000000001'; + +const pushBotAddress = "0x99A08ac6254dcf7ccc37CeC662aeba8eFA666666"; \ No newline at end of file From e5bd9fa3f31a32923acd677300abdac58e779bea Mon Sep 17 00:00:00 2001 From: corlard3y Date: Mon, 27 May 2024 15:25:14 +0100 Subject: [PATCH 06/13] fix: export const --- packages/uiweb/src/lib/config/constants.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/uiweb/src/lib/config/constants.ts b/packages/uiweb/src/lib/config/constants.ts index 9c02052b1..5c1343597 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'; -const pushBotAddress = "0x99A08ac6254dcf7ccc37CeC662aeba8eFA666666"; \ No newline at end of file +export const pushBotAddress = "0x99A08ac6254dcf7ccc37CeC662aeba8eFA666666"; \ No newline at end of file From 7c60e1b9696f6721441e141682a6178d469d933d Mon Sep 17 00:00:00 2001 From: corlard3y Date: Mon, 27 May 2024 15:26:28 +0100 Subject: [PATCH 07/13] fix: reset chat_id --- packages/examples/sdk-frontend-react/src/app/constants.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/examples/sdk-frontend-react/src/app/constants.ts b/packages/examples/sdk-frontend-react/src/app/constants.ts index 4813d44d1..f7acc7974 100644 --- a/packages/examples/sdk-frontend-react/src/app/constants.ts +++ b/packages/examples/sdk-frontend-react/src/app/constants.ts @@ -1,3 +1,3 @@ // the unique id for a chat or the receivers's wallet ddress or domain name export const CHAT_ID = - '0x99A08ac6254dcf7ccc37CeC662aeba8eFA666666'; + '34c44214589cecc176a136ee1daf0f0231ecc6d6574b920b5ae39eb971fa3cb4'; From 74be11e69ae036b3a9780027c037f809e60129a5 Mon Sep 17 00:00:00 2001 From: corlard3y Date: Mon, 27 May 2024 15:41:52 +0100 Subject: [PATCH 08/13] fix: remove console --- .../uiweb/src/lib/components/chat/ChatPreview/ChatPreview.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/uiweb/src/lib/components/chat/ChatPreview/ChatPreview.tsx b/packages/uiweb/src/lib/components/chat/ChatPreview/ChatPreview.tsx index c38f4be94..ef072b21b 100644 --- a/packages/uiweb/src/lib/components/chat/ChatPreview/ChatPreview.tsx +++ b/packages/uiweb/src/lib/components/chat/ChatPreview/ChatPreview.tsx @@ -51,7 +51,6 @@ export const ChatPreview: React.FC = (options: IChatPreviewPr })(); }, []); - console.log(options?.chatPreviewPayload?.chatId, 'log log') // For blockie if icon is missing const blockieContainerRef = useRef(null); From d8241be53f1c4e6fb07624c666e6228fccadc07a Mon Sep 17 00:00:00 2001 From: corlard3y Date: Mon, 27 May 2024 19:28:47 +0100 Subject: [PATCH 09/13] fix: update dark mode theme --- .../chat/ChatPreview/ChatPreview.tsx | 1 + .../chat/ChatViewList/ChatViewList.tsx | 4 ++- .../chat/ChatViewList/MessageEncryption.tsx | 1 + .../chat/reusables/ProfileContainer.tsx | 2 ++ .../src/lib/components/chat/theme/index.ts | 33 ++++++++++++++++++- .../components/reusables/sharedStyling.tsx | 26 ++++++--------- 6 files changed, 49 insertions(+), 18 deletions(-) diff --git a/packages/uiweb/src/lib/components/chat/ChatPreview/ChatPreview.tsx b/packages/uiweb/src/lib/components/chat/ChatPreview/ChatPreview.tsx index 7bb3b94e8..ad1f8fc84 100644 --- a/packages/uiweb/src/lib/components/chat/ChatPreview/ChatPreview.tsx +++ b/packages/uiweb/src/lib/components/chat/ChatPreview/ChatPreview.tsx @@ -159,6 +159,7 @@ export const ChatPreview: React.FC = (options: IChatPreviewPr flex="initial" cursor="pointer" className={options.readmode ? 'skeleton' : ''} + animation={theme.skeletonBG} > {options?.chatPreviewPayload?.chatMsg?.messageType === 'Image' || diff --git a/packages/uiweb/src/lib/components/chat/ChatViewList/ChatViewList.tsx b/packages/uiweb/src/lib/components/chat/ChatViewList/ChatViewList.tsx index f51098d0b..421f6040a 100644 --- a/packages/uiweb/src/lib/components/chat/ChatViewList/ChatViewList.tsx +++ b/packages/uiweb/src/lib/components/chat/ChatViewList/ChatViewList.tsx @@ -293,7 +293,9 @@ export const ChatViewList: React.FC = (options: IChatViewLis return () => clearTimeout(timer); } - return () => {}; + return () => { + // add comment + }; }, [chatAcceptStream, participantJoinStream]); // Change listtype to 'UINITIALIZED' and hidden to true when participantRemoveStream or participantLeaveStream is received diff --git a/packages/uiweb/src/lib/components/chat/ChatViewList/MessageEncryption.tsx b/packages/uiweb/src/lib/components/chat/ChatViewList/MessageEncryption.tsx index af70cfd80..3cc213f63 100644 --- a/packages/uiweb/src/lib/components/chat/ChatViewList/MessageEncryption.tsx +++ b/packages/uiweb/src/lib/components/chat/ChatViewList/MessageEncryption.tsx @@ -68,6 +68,7 @@ export const EncryptionMessage = ({ id, className }: { id: EncryptionKeys; class fontWeight="400" textAlign="left" className={className} + animation={theme.skeletonBG} > {EncryptionMessageContent[id].text} diff --git a/packages/uiweb/src/lib/components/chat/reusables/ProfileContainer.tsx b/packages/uiweb/src/lib/components/chat/reusables/ProfileContainer.tsx index 795bc74fa..167cef78d 100644 --- a/packages/uiweb/src/lib/components/chat/reusables/ProfileContainer.tsx +++ b/packages/uiweb/src/lib/components/chat/reusables/ProfileContainer.tsx @@ -73,6 +73,7 @@ export const ProfileContainer = ({ theme, member, copy, customStyle, loading }: borderRadius="100%" overflow="hidden" className={loading ? 'skeleton' : ''} + animation={theme.skeletonBG} > {member?.icon && ( + css` + ${lightSkeletonLoading} 1s linear infinite alternate; +`; + +const darkAnimation = () => + css` + ${darkSkeletonLoading} 1s linear infinite alternate; +`; + //dark theme object export const lightChatTheme: IChatTheme = { borderRadius: { @@ -368,6 +397,7 @@ export const lightChatTheme: IChatTheme = { backdropFilter: 'none', spinnerColor: 'rgb(202, 89, 155)', scrollbarColor: 'rgb(202, 89, 155)', + skeletonBG: animation }; export const darkChatTheme: IChatTheme = { @@ -541,4 +571,5 @@ export const darkChatTheme: IChatTheme = { backdropFilter: 'none', spinnerColor: 'rgb(202, 89, 155)', scrollbarColor: 'rgb(202, 89, 155)', + skeletonBG: darkAnimation }; diff --git a/packages/uiweb/src/lib/components/reusables/sharedStyling.tsx b/packages/uiweb/src/lib/components/reusables/sharedStyling.tsx index 806fb13b3..6d67187fc 100644 --- a/packages/uiweb/src/lib/components/reusables/sharedStyling.tsx +++ b/packages/uiweb/src/lib/components/reusables/sharedStyling.tsx @@ -1,14 +1,5 @@ -import styled, { keyframes } from 'styled-components'; +import styled from 'styled-components'; -// Define keyframes -const skeletonLoading = keyframes` - 0% { - background-color: hsl(200, 20%, 80%); - } - 100% { - background-color: hsl(200, 20%, 95%); - } -`; // Define types and export components type SectionStyleProps = { @@ -45,6 +36,7 @@ type SectionStyleProps = { visibility?: string; zIndex?: string; fontSize?: string; + animation?: string; }; export const Section = styled.div` @@ -84,7 +76,7 @@ export const Section = styled.div` &.skeleton { > * { - visibility: ${(props) => (props.visibility || skeletonLoading ? 'hidden' : 'visible')}; + visibility: ${(props) => (props.visibility || props.animation ? 'hidden' : 'visible')}; } &:after { @@ -95,7 +87,7 @@ export const Section = styled.div` left: 0; right: 0; z-index: 1; - animation: ${skeletonLoading} 1s linear infinite alternate; + animation: ${(props) => props.animation}; border-radius: 8px; } } @@ -112,6 +104,7 @@ type DivStyleProps = { borderRadius?: string; textAlign?: string; visibility?: string; + animation?: string; }; export const Div = styled.div` height: ${(props) => props.height || 'auto'}; @@ -126,7 +119,7 @@ export const Div = styled.div` &.skeleton { > * { - visibility: ${(props) => (props.visibility || skeletonLoading ? 'hidden' : 'visible')}; + visibility: ${(props) => (props.visibility || props.animation ? 'hidden' : 'visible')}; } &:after { @@ -138,7 +131,7 @@ export const Div = styled.div` right: 0; opacity: 1; z-index: 1; - animation: ${skeletonLoading} 1s linear infinite alternate; + animation: ${(props) => props.animation}; border-radius: 8px; } } @@ -170,6 +163,7 @@ type SpanStyleProps = { whiteSpace?: string; visibility?: string; textWrap?: string; + animation?: string; }; export const Span = styled.span` @@ -201,7 +195,7 @@ export const Span = styled.span` &.skeleton { > * { - visibility: ${(props) => (props.visibility || skeletonLoading ? 'hidden' : 'visible')}; + visibility: ${(props) => (props.visibility || props.animation ? 'hidden' : 'visible')}; } &:after { @@ -213,7 +207,7 @@ export const Span = styled.span` right: 0; opacity: 1; z-index: 1; - animation: ${skeletonLoading} 1s linear infinite alternate; + animation: ${(props) => props.animation}; border-radius: 8px; } } From 122fb4469ec867b9c6fc89625de901ff5fcf4741 Mon Sep 17 00:00:00 2001 From: corlard3y Date: Mon, 27 May 2024 20:42:00 +0100 Subject: [PATCH 10/13] fix: code review comments --- .../uiweb/src/lib/components/chat/ChatPreview/ChatPreview.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/uiweb/src/lib/components/chat/ChatPreview/ChatPreview.tsx b/packages/uiweb/src/lib/components/chat/ChatPreview/ChatPreview.tsx index ef072b21b..ea9503720 100644 --- a/packages/uiweb/src/lib/components/chat/ChatPreview/ChatPreview.tsx +++ b/packages/uiweb/src/lib/components/chat/ChatPreview/ChatPreview.tsx @@ -51,6 +51,8 @@ export const ChatPreview: React.FC = (options: IChatPreviewPr })(); }, []); + const hasBadgeCount = !!options?.badge?.count; + const isBot = options?.chatPreviewPayload?.chatId === pushBotAddress; // For blockie if icon is missing const blockieContainerRef = useRef(null); @@ -195,7 +197,7 @@ export const ChatPreview: React.FC = (options: IChatPreviewPr options?.chatPreviewPayload?.chatMsg?.messageContent )} - {!!options?.badge?.count && !options?.selected && options?.chatPreviewPayload?.chatId === pushBotAddress && {options.badge.count}} + {hasBadgeCount && !options?.selected && isBot && {options.badge.count}} From ed630b52b3902a2f78600373061975858a11e7aa Mon Sep 17 00:00:00 2001 From: corlard3y Date: Mon, 27 May 2024 20:51:19 +0100 Subject: [PATCH 11/13] fix: add null check --- .../uiweb/src/lib/components/chat/ChatPreview/ChatPreview.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/uiweb/src/lib/components/chat/ChatPreview/ChatPreview.tsx b/packages/uiweb/src/lib/components/chat/ChatPreview/ChatPreview.tsx index ea9503720..521e7f37e 100644 --- a/packages/uiweb/src/lib/components/chat/ChatPreview/ChatPreview.tsx +++ b/packages/uiweb/src/lib/components/chat/ChatPreview/ChatPreview.tsx @@ -197,7 +197,8 @@ export const ChatPreview: React.FC = (options: IChatPreviewPr options?.chatPreviewPayload?.chatMsg?.messageContent )} - {hasBadgeCount && !options?.selected && isBot && {options.badge.count}} + + {hasBadgeCount && !options?.selected && isBot && {options.badge?.count}} From 19f3f6b757044e4f1ac1e6b312e23c059b165200 Mon Sep 17 00:00:00 2001 From: corlard3y Date: Mon, 27 May 2024 21:39:26 +0100 Subject: [PATCH 12/13] fix: update conditions --- .../sdk-frontend-react/src/app/ChatUITest/ChatPreview.tsx | 2 +- .../uiweb/src/lib/components/chat/ChatPreview/ChatPreview.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatPreview.tsx b/packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatPreview.tsx index 7f278a75b..56047bc40 100644 --- a/packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatPreview.tsx +++ b/packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatPreview.tsx @@ -56,7 +56,7 @@ const ChatPreviewTest = () => { }, }} badge={{ count: 2 }} - selected={true} + selected={false} setSelected={console.log('Selected')} /> diff --git a/packages/uiweb/src/lib/components/chat/ChatPreview/ChatPreview.tsx b/packages/uiweb/src/lib/components/chat/ChatPreview/ChatPreview.tsx index 521e7f37e..1c3dbd8f4 100644 --- a/packages/uiweb/src/lib/components/chat/ChatPreview/ChatPreview.tsx +++ b/packages/uiweb/src/lib/components/chat/ChatPreview/ChatPreview.tsx @@ -198,7 +198,7 @@ export const ChatPreview: React.FC = (options: IChatPreviewPr )} - {hasBadgeCount && !options?.selected && isBot && {options.badge?.count}} + {((hasBadgeCount || isBot) && !options?.selected) && {options.badge?.count}} From 8c45b548a6e0b7e0bed8e370aec0e9a675083ff8 Mon Sep 17 00:00:00 2001 From: corlard3y Date: Wed, 29 May 2024 06:06:49 +0100 Subject: [PATCH 13/13] 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