-
Notifications
You must be signed in to change notification settings - Fork 53
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
Support chat class based #843
Conversation
File: packages/examples/sdk-frontend-react/src/app/ChatSupportTest.tsx
File: packages/uiweb/src/lib/components/supportChat/Chat.tsx
File: packages/uiweb/src/lib/components/supportChat/Modal.tsx
File: packages/uiweb/src/lib/helpers/chat/chat.ts
File: packages/uiweb/src/lib/hooks/useSDKSocket.ts
All looks good. |
All looks good. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove console log
Clear unsused variables
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pritipsingh the updation of message from socket is not working properly
All looks good. |
File: packages/examples/sdk-frontend-react/src/app/ChatSupportTest.tsx
File: packages/uiweb/src/lib/components/supportChat/AddressInfo.tsx
File: packages/uiweb/src/lib/components/supportChat/Chat.tsx
File: packages/uiweb/src/lib/components/supportChat/ChatInput.tsx
File: packages/uiweb/src/lib/types/index.ts
|
setAccount(address); | ||
setAccountadd(address); | ||
const userAlice = await PushAPI.initialize(signer, {env: env , account:address}); | ||
setUserAlice(userAlice) | ||
} | ||
else{ | ||
setAccount(account); | ||
setAccountadd(account); | ||
const userAlice = await PushAPI.initialize(signer, {env: env , account:account}); | ||
setUserAlice(userAlice) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we do the initialize in a useEffect, this makes the code redundant?
// sendResponse.messageContent = message; | ||
// setChatsSorted([...chats, sendResponse]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove commented code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am keeping this incase I want to shift to sorting message like this in the future. But rest every other comments I have removed
// const getUpdatedChats = (message:IMessageIPFS) =>{ | ||
// console.log(message) | ||
// if (message && (supportAddress === pCAIP10ToWallet(message?.from))) { | ||
// const chat = await decryptChat({ message, connectedUser, env }); | ||
// socketData.messagesSinceLastConnection.decrypted = true; | ||
|
||
// setChatsSorted([...chats, message]); | ||
// } | ||
// } | ||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this section
File: packages/examples/sdk-frontend-react/src/app/ChatSupportTest.tsx
File: packages/uiweb/src/lib/components/supportChat/AddressInfo.tsx
File: packages/uiweb/src/lib/components/supportChat/Chat.tsx
File: packages/uiweb/src/lib/components/supportChat/ChatInput.tsx
File: packages/uiweb/src/lib/components/supportChat/Chats.tsx
File: packages/uiweb/src/lib/components/supportChat/Modal.tsx
File: packages/uiweb/src/lib/helpers/chat/chat.ts
File: packages/uiweb/src/lib/hooks/useSDKSocket.ts
File: packages/uiweb/src/lib/types/index.ts
File: packages/uiweb/yarn.lock
|
All looks good. |
All looks good. |
Things changed: