You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-30 02:21:17 +03:00
Fixed pagination infinite loop caused by long messages
Signed-off-by: Oliver Hunt <oliver@hunt.bz>
This commit is contained in:
@ -352,13 +352,14 @@ module.exports = React.createClass({
|
|||||||
const tile = tiles[backwards ? i : tiles.length - 1 - i];
|
const tile = tiles[backwards ? i : tiles.length - 1 - i];
|
||||||
// Subtract height of tile as if it were unpaginated
|
// Subtract height of tile as if it were unpaginated
|
||||||
excessHeight -= tile.clientHeight;
|
excessHeight -= tile.clientHeight;
|
||||||
|
//If removing the tile would lead to future pagination, break before setting scroll token
|
||||||
|
if (tile.clientHeight > excessHeight) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
// The tile may not have a scroll token, so guard it
|
// The tile may not have a scroll token, so guard it
|
||||||
if (tile.dataset.scrollTokens) {
|
if (tile.dataset.scrollTokens) {
|
||||||
markerScrollToken = tile.dataset.scrollTokens.split(',')[0];
|
markerScrollToken = tile.dataset.scrollTokens.split(',')[0];
|
||||||
}
|
}
|
||||||
if (tile.clientHeight > excessHeight) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (markerScrollToken) {
|
if (markerScrollToken) {
|
||||||
|
Reference in New Issue
Block a user