Timeline: mark messages read even with no known oldest message

This commit is contained in:
Scott Nonnenberg 2021-06-02 13:32:49 -07:00 committed by GitHub
parent d46963e864
commit 9ea827c033
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -554,7 +554,7 @@ export class Timeline extends React.PureComponent<PropsType, StateType> {
}
const { newest, oldest } = this.visibleRows;
if (!newest || !oldest) {
if (!newest) {
return;
}
@ -579,7 +579,7 @@ export class Timeline extends React.PureComponent<PropsType, StateType> {
// Generally we hid this behind a countdown spinner at the top of the window, but
// this is a special-case for the situation where the window is so large and that
// all the messages are visible.
const oldestVisible = oldestRow === oldest.row;
const oldestVisible = Boolean(oldest && oldestRow === oldest.row);
const newestVisible = newestRow === newest.row;
if (oldestVisible && newestVisible && !haveOldest) {
this.loadOlderMessages();