Skip to content

Commit

Permalink
no need to calculate bottom now that we're using nearBottom
Browse files Browse the repository at this point in the history
  • Loading branch information
jdrews committed Aug 15, 2021
1 parent 6874523 commit 5408158
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions web/src/LogViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ export default class LogViewer extends React.Component {
}

handleScroll = (e) => {
const bottom = e.scrollHeight - e.scrollTop === e.clientHeight;
const nearBottom = e.scrollHeight - e.scrollTop - minRowHeight <= e.clientHeight ?? bottom;
// const bottom = e.scrollHeight - e.scrollTop === e.clientHeight;
const nearBottom = e.scrollHeight - e.scrollTop - minRowHeight <= e.clientHeight;

if (bottom || nearBottom) {
if (nearBottom) {
this.setState({ atBottom: true })
console.log("bottom!")
const list = [ ...this.state.list ];
Expand Down

0 comments on commit 5408158

Please sign in to comment.