Commit b907df6b authored by Sudheer's avatar Sudheer Committed by JoramWilander

MM-13399 more unreads above/below fix for LHS (#2159)

* MM-13399 more unreads above/below doesn't appear until you scroll the LHS

* Check for state of unread indicator before setting them
parent db150114
......@@ -191,10 +191,6 @@ export default class Sidebar extends React.PureComponent {
document.addEventListener('keydown', this.navigateUnreadChannelShortcut);
}
UNSAFE_componentWillUpdate() { // eslint-disable-line camelcase
this.updateUnreadIndicators();
}
componentDidUpdate(prevProps) {
// if the active channel disappeared (which can happen when dm channels autoclose), go to town square
if (this.props.currentTeam === prevProps.currentTeam &&
......@@ -224,6 +220,7 @@ export default class Sidebar extends React.PureComponent {
this.updateTitle();
this.setBadgesActiveAndFavicon();
this.setFirstAndLastUnreadChannels();
this.updateUnreadIndicators();
}
componentWillUnmount() {
......@@ -375,11 +372,12 @@ export default class Sidebar extends React.PureComponent {
showBottomUnread = true;
}
}
this.setState({
showTopUnread,
showBottomUnread,
});
if (showTopUnread !== this.state.showTopUnread || showBottomUnread !== this.state.showBottomUnread) {
this.setState({
showTopUnread,
showBottomUnread,
});
}
}
updateScrollbarOnChannelChange = (channelId) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment