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

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 { ...@@ -191,10 +191,6 @@ export default class Sidebar extends React.PureComponent {
document.addEventListener('keydown', this.navigateUnreadChannelShortcut); document.addEventListener('keydown', this.navigateUnreadChannelShortcut);
} }
UNSAFE_componentWillUpdate() { // eslint-disable-line camelcase
this.updateUnreadIndicators();
}
componentDidUpdate(prevProps) { componentDidUpdate(prevProps) {
// if the active channel disappeared (which can happen when dm channels autoclose), go to town square // if the active channel disappeared (which can happen when dm channels autoclose), go to town square
if (this.props.currentTeam === prevProps.currentTeam && if (this.props.currentTeam === prevProps.currentTeam &&
...@@ -224,6 +220,7 @@ export default class Sidebar extends React.PureComponent { ...@@ -224,6 +220,7 @@ export default class Sidebar extends React.PureComponent {
this.updateTitle(); this.updateTitle();
this.setBadgesActiveAndFavicon(); this.setBadgesActiveAndFavicon();
this.setFirstAndLastUnreadChannels(); this.setFirstAndLastUnreadChannels();
this.updateUnreadIndicators();
} }
componentWillUnmount() { componentWillUnmount() {
...@@ -375,11 +372,12 @@ export default class Sidebar extends React.PureComponent { ...@@ -375,11 +372,12 @@ export default class Sidebar extends React.PureComponent {
showBottomUnread = true; showBottomUnread = true;
} }
} }
if (showTopUnread !== this.state.showTopUnread || showBottomUnread !== this.state.showBottomUnread) {
this.setState({ this.setState({
showTopUnread, showTopUnread,
showBottomUnread, showBottomUnread,
}); });
}
} }
updateScrollbarOnChannelChange = (channelId) => { 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