Merge pull request #5049 from matrix-org/travis/perf5

Ensure notification badges stop listening when they unmount
pull/21833/head
Travis Ralston 2020-07-24 14:08:28 -06:00 committed by GitHub
commit 548b8adb66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -72,6 +72,7 @@ export default class NotificationBadge extends React.PureComponent<XOR<IProps, I
public componentWillUnmount() {
SettingsStore.unwatchSetting(this.countWatcherRef);
this.props.notification.off(NOTIFICATION_STATE_UPDATE, this.onNotificationUpdate);
}
public componentDidUpdate(prevProps: Readonly<IProps>) {