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

fix: socket issue & Chat keeps on going to top #832

Closed
wants to merge 3 commits into from

Conversation

pritipsingh
Copy link
Contributor

Things that are fixed for Support chat:

  • Chat keeps on going to top on sending the message
  • Socket is not listening and updating

Copy link

All looks good.

@pritipsingh pritipsingh changed the base branch from main to alpha November 13, 2023 12:26
Copy link
Contributor

@KlausMikhaelson KlausMikhaelson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when I am sending a text it is scrolling to top and then scrolls back to bottom

@pritipsingh
Copy link
Contributor Author

fix: scroll to top

@KlausMikhaelson check now

Copy link

File: packages/examples/sdk-frontend-react/src/app/ChatSupportTest.tsx

  • The ChatSupportTest component looks good.

File: packages/uiweb/src/lib/components/supportChat/Chat.tsx

  • In the Chat component, there is an unused import statement import { ButtonStyleProps } from './types'; which can be removed.
  • Line 28: There is an extra opening brace after useEffect(() => {. It should be removed.
  • Line 29: There is a missing closing brace for the useEffect hook at the end of the file. It should be added.
  • The rest of the code in the Chat component looks good.

File: packages/uiweb/src/lib/components/supportChat/Modal.tsx

  • In the Modal component, the import { ButtonStyleProps } from './types'; statement is not being used and can be removed.
  • Line 21: There is a missing closing brace for the onScroll function. It should be added.
  • Line 25: The scrollToBottom function is missing a closing brace. It should be added after the listInnerRef.current.scrollTop = listInnerRef.current.scrollHeight +100; line.
  • Line 97: The getUpdatedChats function is missing a closing brace. It should be added after the scrollToBottom(); line.
  • Line 101: The useEffect hook is missing a closing brace for the callback function. It should be added after the getUpdatedChats(socketData.messagesSinceLastConnection); line.
  • The rest of the code in the Modal component looks good.

Overall, the code looks good with some minor issues mentioned above.

const curScrollPos = content.scrollTop;
const oldScroll = content.scrollHeight - content.clientHeight;

await getChatCall();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is no need to await this function here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@KlausMikhaelson it is fetching all the history chats from PushAPI and hence it's nice to make it an async call

@Aman035 Aman035 deleted the branch alpha January 2, 2024 10:11
@Aman035 Aman035 closed this Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants