-
-
Notifications
You must be signed in to change notification settings - Fork 169
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
Refactor chat store logic into dedicated React contexts #3725
Conversation
f7ffb20
to
d4fdb3c
Compare
I think the refactoring is so far complete, I'll look into bugs now which probably occurred after touching so much |
ac07366
to
9a4cf15
Compare
I'm not sure why this is stuck on throwing linting errors about things which do not exist anymore, restarting the CI didn't help .. In any case, this PR is ready for review and merging. |
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.
When switching accounts the account sidebar flickers, we should somehow prevent it from completely reloading (visually popping in unread counters) in that case.
Generally the code looks really nice now! Thanks very much for taking on this refactoring, it's a huge leap forward and was easy to review 🚀 🌟
return | ||
} | ||
|
||
if (!chat) { |
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.
we can also check for chat type, if it's not a 1on1/DM chat then a contact update does not affect it AFAIK
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'm actually not 100% sure why this update is required at all, could you explain what this is for, then I'll add it as a comment. Thank you!
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 guess if contact name, avatar or recently seen changes on a 1on1 chat. maybe only the recently seen
in reality I don't know in my head if the other events trigger a chat update instead or also rely on the ContactsChanged event
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'm still confused why this update is required and why it is only for 1:1 chats. Maybe I'll leave it as-is for now (as this is how it was before as well) and we can add commentary / adjustments later?
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.
Looks like a good refactoring and cleanup to me!
Only some ideas for naming and comments. In general I prefer more verbose comments, they are removed anyway when compiled.
Co-authored-by: Simon Laux <Simon-Laux@users.noreply.github.com>
f7f40f9
to
4a0a2cb
Compare
bfd20f8
to
713c74c
Compare
ChatStore
ChatContext
Closes: #3675