chat: fix page number reset

This commit is contained in:
Logan Allen 2020-08-06 14:44:03 -07:00
parent 42d7e66782
commit 73c9c8e1e1

View File

@ -64,7 +64,7 @@ export class ChatWindow extends Component {
} else if (props.messages.length >= prevProps.messages.length + 10) {
this.hasAskedForMessages = false;
let numPages = props.unreadCount > 0 ?
Math.ceil(props.unreadCount / PAGE_SIZE) : 1;
Math.ceil(props.unreadCount / PAGE_SIZE) : this.state.numPages;
if (this.state.numPages === numPages) {
if (props.unreadCount > 20) {