Skip to content

Commit

Permalink
Be consistent in visible tiles usage
Browse files Browse the repository at this point in the history
  • Loading branch information
turt2live committed Jul 1, 2020
1 parent 8cfbfd4 commit 946fde5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/views/rooms/RoomSublist2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ export default class RoomSublist2 extends React.Component<IProps, IState> {
// floats above the resize handle, if we have one present. If the user has all
// tiles visible, it becomes 'show less'.
let showNButton = null;
if (this.numTiles > this.numVisibleTiles) {
if (this.numTiles > visibleTiles.length) {
// we have a cutoff condition - add the button to show all
const numMissing = this.numTiles - visibleTiles.length;
let showMoreText = (
Expand All @@ -387,7 +387,7 @@ export default class RoomSublist2 extends React.Component<IProps, IState> {
{showMoreText}
</div>
);
} else if (this.numTiles <= this.numVisibleTiles && this.numTiles > this.props.layout.defaultVisibleTiles) {
} else if (this.numTiles <= visibleTiles.length && this.numTiles > this.props.layout.defaultVisibleTiles) {
// we have all tiles visible - add a button to show less
let showLessText = (
<span className='mx_RoomSublist2_showNButtonText'>
Expand Down

0 comments on commit 946fde5

Please sign in to comment.