Skip to content

Commit

Permalink
fix: fixed stream issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mishramonalisha76 committed Nov 6, 2024
1 parent 202ea53 commit ccd831b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { ProfileContainer } from '../reusables';
import { ThemeContext } from '../theme/ThemeProvider';
import { UpdateUserProfileModal } from './UpdateUserProfileModal';

import { device } from '../../../config';
import { GUEST_MODE_ACCOUNT, device } from '../../../config';
import VerticalEllipsisIcon from '../../../icons/VerticalEllipsis.svg';
import UserProfileIcon from '../../../icons/userCircleGear.svg';
import { MODAL_BACKGROUND_TYPE, MODAL_POSITION_TYPE } from '../../../types';
Expand Down Expand Up @@ -96,7 +96,7 @@ export const UserProfile: React.FC<UserProfileProps> = ({
member={{
web3Name: web3Name,
abbrRecipient: shortenText(pCAIP10ToWallet(user?.account || ''), 8, true) as string,
recipient: user!.account,
recipient: user?.account || GUEST_MODE_ACCOUNT,
icon: userProfile?.profile?.picture || null,
}}
copy={true}
Expand Down
8 changes: 4 additions & 4 deletions packages/uiweb/src/lib/dataProviders/ChatDataProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,9 @@ export const ChatUIProvider = ({

// check and filter out the streams which are not connected
const streamsToConnect = streams.filter((stream) => !connectedStreams.listen?.includes(stream));

const uniqueStreams = [...new Set([...connectedStreams.listen, ...streams])];
if (streamsToConnect.length) {
await userInstance.stream?.reinit(streams, {
await userInstance.stream?.reinit(uniqueStreams, {
connection: {
retries: 3, // number of retries in case of error
},
Expand Down Expand Up @@ -415,10 +415,10 @@ export const ChatUIProvider = ({

// setTimeout(async () => {
// console.debug('UIWeb::ChatDataProvider::attachListenersAndConnect::Timeout Connect', userInstance?.stream?.uid);
if (!userInstance.stream?.connected()) {
if (!userInstance?.stream?.connected()) {
console.debug('UIWeb::ChatDataProvider::attachListenersAndConnect::Stream not connected', userInstance);

await userInstance.stream?.connect();
await userInstance?.stream?.connect();
console.debug(
'UIWeb::ChatDataProvider::attachListenersAndConnect::Stream listeners attached and stream connected',
userInstance?.stream?.uid
Expand Down

0 comments on commit ccd831b

Please sign in to comment.