mirror of
https://github.com/nickzuber/meteorite.git
synced 2024-08-16 23:10:38 +03:00
Fix bug with sign in/out triggering updates
This commit is contained in:
parent
e1a18b057e
commit
771dbff2ac
@ -65,11 +65,15 @@ class NotificationsProvider extends React.Component {
|
||||
}
|
||||
|
||||
shouldComponentUpdate (nextProps, nextState) {
|
||||
// Update if our state changes
|
||||
// Update if our state changes.
|
||||
if ((this.state.loading !== nextState.loading) ||
|
||||
(this.state.error !== nextState.error)) {
|
||||
return true;
|
||||
}
|
||||
// Update if the token changes at all (sign in & sign out).
|
||||
if (this.props.token !== nextProps.token) {
|
||||
return true;
|
||||
}
|
||||
// Only update if our notifications prop changes.
|
||||
// All other props "changing" should NOT trigger a rerender.
|
||||
return this.props.notifications !== nextProps.notifications;
|
||||
|
Loading…
Reference in New Issue
Block a user