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

Logic error in useListenMessages hook #9

Closed
iamgodot opened this issue Mar 20, 2024 · 1 comment
Closed

Logic error in useListenMessages hook #9

iamgodot opened this issue Mar 20, 2024 · 1 comment

Comments

@iamgodot
Copy link

First of all thank you for this app, I followed through and learned a lot about developing chat app.

There's an issue I'd like to point out though, which resides in the useListenMessages hook. The current implementation updates messages whenever a new message comes in without checking the sender, meaning if I'm opening the conversation with A, then new messages from B will also update the chat window. The solution is to simply check if the sender matches the current conversation, and then update current messages accordingly.

Then again, it was a good run with your YT tutorial, thanks again.

@iamgodot
Copy link
Author

I just saw #2 which points out the same thing, so I'll close this one.

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

No branches or pull requests

1 participant