diff options
author | 2018-12-08 23:42:49 +0100 | |
---|---|---|
committer | 2018-12-08 23:42:49 +0100 | |
commit | d15efc6ba99ab26735dcf7a83303ab0b148ecd46 (patch) | |
tree | 8d9418351b9cc5cd394b9fa41ee248dae0361c1d /src/containers/settings | |
parent | Fix linting issues (diff) | |
download | ferdium-app-d15efc6ba99ab26735dcf7a83303ab0b148ecd46.tar.gz ferdium-app-d15efc6ba99ab26735dcf7a83303ab0b148ecd46.tar.zst ferdium-app-d15efc6ba99ab26735dcf7a83303ab0b148ecd46.zip |
Dispose autorun on component unmount
Diffstat (limited to 'src/containers/settings')
-rw-r--r-- | src/containers/settings/RecipesScreen.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/containers/settings/RecipesScreen.js b/src/containers/settings/RecipesScreen.js index 4efe81505..b125e6a05 100644 --- a/src/containers/settings/RecipesScreen.js +++ b/src/containers/settings/RecipesScreen.js | |||
@@ -32,7 +32,7 @@ export default @inject('stores', 'actions') @observer class RecipesScreen extend | |||
32 | componentDidMount() { | 32 | componentDidMount() { |
33 | gaPage('Settings/Recipe Dashboard/Featured'); | 33 | gaPage('Settings/Recipe Dashboard/Featured'); |
34 | 34 | ||
35 | autorun(() => { | 35 | this.autorunDisposer = autorun(() => { |
36 | const { filter } = this.props.params; | 36 | const { filter } = this.props.params; |
37 | const { currentFilter } = this.state; | 37 | const { currentFilter } = this.state; |
38 | 38 | ||
@@ -51,8 +51,11 @@ export default @inject('stores', 'actions') @observer class RecipesScreen extend | |||
51 | 51 | ||
52 | componentWillUnmount() { | 52 | componentWillUnmount() { |
53 | this.props.stores.services.resetStatus(); | 53 | this.props.stores.services.resetStatus(); |
54 | this.autorunDisposer(); | ||
54 | } | 55 | } |
55 | 56 | ||
57 | autorunDisposer = null; | ||
58 | |||
56 | searchRecipes(needle) { | 59 | searchRecipes(needle) { |
57 | if (needle === '') { | 60 | if (needle === '') { |
58 | this.resetSearch(); | 61 | this.resetSearch(); |