From f4f11a312b48ffc88cc4cf72937c5b86b1431e56 Mon Sep 17 00:00:00 2001 From: NejcZdovc Date: Wed, 19 Apr 2017 09:26:39 +0200 Subject: [PATCH] Removes last check when component is unmounting Auditors: @bridiver --- app/renderer/components/reduxComponent.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/renderer/components/reduxComponent.js b/app/renderer/components/reduxComponent.js index f6ee73fc273..c81a063e6ba 100644 --- a/app/renderer/components/reduxComponent.js +++ b/app/renderer/components/reduxComponent.js @@ -19,10 +19,11 @@ class ReduxComponent extends ImmutableComponent { this.componentType = props.componentType this.state = buildPropsImpl(props, this.componentType) this.checkForUpdates = this.checkForUpdates.bind(this) + this.dontCheck = false } checkForUpdates () { - if (this.shouldComponentUpdate(this.props, this.buildProps())) { + if (!this.dontCheck && this.shouldComponentUpdate(this.props, this.buildProps())) { this.forceUpdate() } } @@ -33,6 +34,7 @@ class ReduxComponent extends ImmutableComponent { } componentWillUnmount () { + this.dontCheck = true appStore.removeChangeListener(this.checkForUpdates) windowStore.removeChangeListener(this.checkForUpdates) }