add algo to ensure that RM always moves forwards
this is needed so that if a client which does not hide any events sets and RM at bottom of timeline, then riot-web which hides events sets the RM it'd set it at X-N where X is bottom and N is the amount of hidden events at bottom of the timeline, this way now an RM will fall through to the hidden events below a seen event. Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
b976649b5b
commit
c9b547368b
1 changed files with 8 additions and 1 deletions
|
@ -1020,7 +1020,14 @@ var TimelinePanel = React.createClass({
|
|||
var boundingRect = node.getBoundingClientRect();
|
||||
if ((allowPartial && boundingRect.top < wrapperRect.bottom) ||
|
||||
(!allowPartial && boundingRect.bottom < wrapperRect.bottom)) {
|
||||
return i;
|
||||
let latestReadEventIndex = i;
|
||||
// Place the RM at a hidden event below the latest seen event (if exists)
|
||||
// to prevent RM going up the timeline between clients which do not hide the same events.
|
||||
for (let j = i; j < this.state.events.length; ++j) {
|
||||
if (messagePanel._shouldShowEvent(this.state.events[j])) break;
|
||||
latestReadEventIndex = j;
|
||||
}
|
||||
return latestReadEventIndex;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
|
Loading…
Reference in a new issue