Merge pull request #1045 from ollieh/issues/4009

Fixed pagination infinite loop caused by long messages
pull/21833/head
Luke Barnard 2017-06-14 10:40:02 +01:00 committed by GitHub
commit 040f28463d
1 changed files with 4 additions and 3 deletions

View File

@ -352,13 +352,14 @@ module.exports = React.createClass({
const tile = tiles[backwards ? i : tiles.length - 1 - i];
// Subtract height of tile as if it were unpaginated
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
if (tile.dataset.scrollTokens) {
markerScrollToken = tile.dataset.scrollTokens.split(',')[0];
}
if (tile.clientHeight > excessHeight) {
break;
}
}
if (markerScrollToken) {