mirror of
https://github.com/urbit/shrub.git
synced 2025-01-02 01:25:55 +03:00
chat: fixed brave slam to bottom issue
This commit is contained in:
parent
864354546a
commit
f6e78f51fd
@ -77,7 +77,11 @@ export class ChatWindow extends Component {
|
||||
}
|
||||
});
|
||||
}
|
||||
} else if (state.numPages === 1 && this.props.unreadCount < INITIAL_LOAD) {
|
||||
} else if (
|
||||
state.numPages === 1 &&
|
||||
this.props.unreadCount < INITIAL_LOAD &&
|
||||
this.props.unreadCount > 0
|
||||
) {
|
||||
this.dismissUnread();
|
||||
this.scrollToBottom();
|
||||
}
|
||||
@ -139,12 +143,10 @@ export class ChatWindow extends Component {
|
||||
|
||||
render() {
|
||||
const { props, state } = this;
|
||||
const sliceLength = (
|
||||
state.numPages * PAGE_SIZE <
|
||||
const sliceLength = Math.min(
|
||||
state.numPages * PAGE_SIZE,
|
||||
props.messages.length + props.pendingMessages.length
|
||||
) ? state.numPages * PAGE_SIZE :
|
||||
props.messages.length + props.pendingMessages.length;
|
||||
|
||||
);
|
||||
const messages =
|
||||
props.pendingMessages
|
||||
.concat(props.messages)
|
||||
|
Loading…
Reference in New Issue
Block a user