mirror of https://github.com/vector-im/riot-web
Ensure notification badges stop listening when they unmount
parent
fbdbbce529
commit
593b472e50
|
@ -72,6 +72,9 @@ export default class NotificationBadge extends React.PureComponent<XOR<IProps, I
|
|||
|
||||
public componentWillUnmount() {
|
||||
SettingsStore.unwatchSetting(this.countWatcherRef);
|
||||
if (this.props.notification) {
|
||||
this.props.notification.off(NOTIFICATION_STATE_UPDATE, this.onNotificationUpdate);
|
||||
}
|
||||
}
|
||||
|
||||
public componentDidUpdate(prevProps: Readonly<IProps>) {
|
||||
|
|
Loading…
Reference in New Issue