Skip to content

Commit

Permalink
fixed msg receiving issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Bhupesh-mfsi authored and hai-ko committed Nov 17, 2023
1 parent 3c20f9c commit 8909c61
Show file tree
Hide file tree
Showing 3 changed files with 233 additions and 107 deletions.
2 changes: 1 addition & 1 deletion packages/messenger-demo/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function App() {
ethereumProvider: process.env.REACT_APP_ETHEREUM_PROVIDER,
walletConnectProjectId: process.env.REACT_APP_WALLET_CONNECT_PROJECT_ID,
showAlways: true,
hideFunction: undefined, // OPTINAL PARAMETER : 'attachments,edit,delete'
hideFunction: 'attachments,edit,delete', // OPTINAL PARAMETER : 'attachments,edit,delete' or undefined
};

return (
Expand Down
10 changes: 10 additions & 0 deletions packages/messenger-widget/src/components/Contacts/Contacts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
fetchMessageSizeLimit,
updateUnreadMsgCount,
fetchAndUpdateUnreadMsgCount,
addNewConversationFound,
} from './bl';
import { useContext, useEffect, useState } from 'react';
import { GlobalContext } from '../../utils/context-utils';
Expand Down Expand Up @@ -107,6 +108,15 @@ export function Contacts(props: DashboardProps) {
setContactFromList,
);
}

// new contact is detected from web socket
if (
state.accounts.contacts &&
state.cache.contacts &&
state.cache.contacts.length !== state.accounts.contacts.length
) {
addNewConversationFound(state, dispatch, setListOfContacts);
}
}, [state.accounts.contacts]);

// handles contact selected
Expand Down
Loading

0 comments on commit 8909c61

Please sign in to comment.