Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Removes last check when component is unmounting
Browse files Browse the repository at this point in the history
Auditors: @bridiver
  • Loading branch information
NejcZdovc committed Apr 19, 2017
1 parent 90d9290 commit f4f11a3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/renderer/components/reduxComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}
Expand All @@ -33,6 +34,7 @@ class ReduxComponent extends ImmutableComponent {
}

componentWillUnmount () {
this.dontCheck = true
appStore.removeChangeListener(this.checkForUpdates)
windowStore.removeChangeListener(this.checkForUpdates)
}
Expand Down

0 comments on commit f4f11a3

Please sign in to comment.