Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 [BUG] - Chat badge getting updated for active/opened conversation> #1323

Merged
merged 10 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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')}
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -50,6 +51,7 @@ export const ChatPreview: React.FC<IChatPreviewProps> = (options: IChatPreviewPr
})();
}, []);


corlard3y marked this conversation as resolved.
Show resolved Hide resolved
// For blockie if icon is missing
const blockieContainerRef = useRef<HTMLDivElement>(null);

Expand Down Expand Up @@ -193,7 +195,7 @@ export const ChatPreview: React.FC<IChatPreviewProps> = (options: IChatPreviewPr
options?.chatPreviewPayload?.chatMsg?.messageContent
)}
</Message>
{!!options?.badge?.count && <Badge theme={theme}>{options.badge.count}</Badge>}
{!!options?.badge?.count && !options?.selected && options?.chatPreviewPayload?.chatId === pushBotAddress && <Badge theme={theme}>{options.badge.count}</Badge>}
corlard3y marked this conversation as resolved.
Show resolved Hide resolved
</Section>
</Section>
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,9 @@ export const ChatViewList: React.FC<IChatViewListProps> = (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
Expand Down
2 changes: 2 additions & 0 deletions packages/uiweb/src/lib/config/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

export const pushBotAddress = "0x99A08ac6254dcf7ccc37CeC662aeba8eFA666666";
Loading