Closed MrMole96 closed 1 month ago
Hey @MrMole96 , the video you attached is not reproducible and not downloadable. I could not reproduce your issue in the sandbox. I have used your ScrollToBottomButton
component removing the useAtom
hooks. I expect that you want to see Count 0 on the button once it is clicked.
What I see in your code is that you re-create MessageNotification
component on each re-render. This could contribute to your problems. The components should be declared outside the parent component scope or at least memoized inside the parent component if it is necessary to create them inside.
Please see the attached video of my demo showing the unread count is passed correctly.
Hey @MartinCupela thanks for quick response! Yes, your example for very helpful and it started working. I noticed also two things.
If I open chat with unread messages, I can see label "unread messages" button with number of unread messages count but in channel preview (left side) I don't see anymore number because this channel is tagged as read. Is it intended behaviour?
Is it possible to decrease number of unread messages during scrolling? For example I have big number like 100 messages and I would like to see 90->80->70 when I scroll down screen.
https://github.com/user-attachments/assets/c722a97b-0c17-4db6-a92e-248f5980afab
@MrMole96 to your questions:
I will go ahead and close this issue as solved
Describe the bug
MessageNotification is not updated after
await channel.markRead()
funcTo Reproduce
Steps to reproduce the behavior:
MessageNotification
propertyand then inside of
SCrollToBottomButton
To fetch number of unread_messages on left side (ChannelPreview) I have this function
Expected behavior
MessageNotification should be updated and number of unread messages in
ScrollToBottomButton
component should be 0Screenshots
https://github.com/user-attachments/assets/7e5972aa-a674-46ee-9b2e-bc81b468666b
Package version
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.