You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-28 15:22:05 +03:00
implement basic local echo for resetting unread message count when opening a room without a scroll offset. hopefully largely fixes https://github.com/vector-im/vector-web/issues/967
This commit is contained in:
@ -399,6 +399,14 @@ var TimelinePanel = React.createClass({
|
||||
sendReadReceipt: function() {
|
||||
if (!this.refs.messagePanel) return;
|
||||
|
||||
// if we are scrolled to the bottom, do a quick-reset of our unreadNotificationCount
|
||||
// to avoid having to wait from the remote echo from the homeserver.
|
||||
if (this.getScrollState().stuckAtBottom) {
|
||||
this.props.room.setUnreadNotificationCount('total', 0);
|
||||
this.props.room.setUnreadNotificationCount('highlight', 0);
|
||||
// XXX: i'm a bit surprised we don't have to emit an event or dispatch to make the echo picked up
|
||||
}
|
||||
|
||||
var currentReadUpToEventId = this._getCurrentReadReceipt(true);
|
||||
var currentReadUpToEventIndex = this._indexForEventId(currentReadUpToEventId);
|
||||
|
||||
|
Reference in New Issue
Block a user