diff --git a/src/providers/Notifications.js b/src/providers/Notifications.js index 8d50387..cf008a6 100644 --- a/src/providers/Notifications.js +++ b/src/providers/Notifications.js @@ -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;