Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Conversation

@lukebarnard1
Copy link
Contributor

@lukebarnard1 lukebarnard1 commented Mar 28, 2017

Use an action and force an update when zeroing the number of notifications in a room. This is better than waiting for a render to happen at some point. This will probably not fix element-hq/element-web#3257

Use an action and force an update when zeroing the number of notifications in a room. This is better than waiting for a `render` to happen at some point. This will hopefully fix element-hq/element-web#3257
if (this.isAtEndOfLiveTimeline()) {
this.props.timelineSet.room.setUnreadNotificationCount('total', 0);
this.props.timelineSet.room.setUnreadNotificationCount('highlight', 0);
// XXX: i'm a bit surprised we don't have to emit an event or dispatch to get this picked up
Copy link
Member

Choose a reason for hiding this comment

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

What I would do here is keep the setUnreadNotificationCount here and just forceUpdate when the dispatch is caught, otherwise you risk setUnreadNotificationCount happening twice if many things want to handle the dispatch.

@dbkr dbkr assigned lukebarnard1 and unassigned dbkr Mar 28, 2017
By not sending the room with the action, we prevent its state from being updated by registered views listening for on_room_read
@lukebarnard1 lukebarnard1 assigned dbkr and unassigned lukebarnard1 Mar 28, 2017
@dbkr dbkr merged commit 91d1064 into develop Mar 28, 2017
martindale pushed a commit to FabricLabs/matrix-react-sdk that referenced this pull request Dec 8, 2018
Remove the request-only stuff we don't need anymore
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

3 participants