You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-09 14:21:50 +03:00
Make sure we update the timelinepanel when a read-receipt arrives
Fixes https://github.com/vector-im/vector-web/issues/1094
This commit is contained in:
@ -118,6 +118,7 @@ var TimelinePanel = React.createClass({
|
||||
MatrixClientPeg.get().on("Room.timeline", this.onRoomTimeline);
|
||||
MatrixClientPeg.get().on("Room.timelineReset", this.onRoomTimelineReset);
|
||||
MatrixClientPeg.get().on("Room.redaction", this.onRoomRedaction);
|
||||
MatrixClientPeg.get().on("Room.receipt", this.onRoomReceipt);
|
||||
|
||||
this._initTimeline(this.props);
|
||||
},
|
||||
@ -159,6 +160,7 @@ var TimelinePanel = React.createClass({
|
||||
client.removeListener("Room.timeline", this.onRoomTimeline);
|
||||
client.removeListener("Room.timelineReset", this.onRoomTimelineReset);
|
||||
client.removeListener("Room.redaction", this.onRoomRedaction);
|
||||
client.removeListener("Room.receipt", this.onRoomReceipt);
|
||||
}
|
||||
},
|
||||
|
||||
@ -280,6 +282,15 @@ var TimelinePanel = React.createClass({
|
||||
this.forceUpdate();
|
||||
},
|
||||
|
||||
onRoomReceipt: function(ev, room) {
|
||||
if (this.unmounted) return;
|
||||
|
||||
// ignore events for other rooms
|
||||
if (room !== this.props.room) return;
|
||||
|
||||
this.forceUpdate();
|
||||
},
|
||||
|
||||
sendReadReceipt: function() {
|
||||
if (!this.refs.messagePanel) return;
|
||||
|
||||
|
Reference in New Issue
Block a user