diff options
author | Stefan Malzner <stefan@adlk.io> | 2019-06-13 15:48:23 +0200 |
---|---|---|
committer | Stefan Malzner <stefan@adlk.io> | 2019-06-13 15:48:23 +0200 |
commit | e5fbcfc9eb02a1cbb1c5876a3c1a01f79ad15180 (patch) | |
tree | 676d3c5478a7279d3cf510ad3f620ed2d3a76491 /src/stores/NewsStore.js | |
parent | Add custom recipe limitation (diff) | |
parent | Merge branch 'release/5.2.0-beta.2' (diff) | |
download | ferdium-app-e5fbcfc9eb02a1cbb1c5876a3c1a01f79ad15180.tar.gz ferdium-app-e5fbcfc9eb02a1cbb1c5876a3c1a01f79ad15180.tar.zst ferdium-app-e5fbcfc9eb02a1cbb1c5876a3c1a01f79ad15180.zip |
Merge branch 'develop' into feature/3rd-party-limit
Diffstat (limited to 'src/stores/NewsStore.js')
-rw-r--r-- | src/stores/NewsStore.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/stores/NewsStore.js b/src/stores/NewsStore.js index 6984425df..86e092592 100644 --- a/src/stores/NewsStore.js +++ b/src/stores/NewsStore.js | |||
@@ -16,6 +16,7 @@ export default class NewsStore extends Store { | |||
16 | 16 | ||
17 | // Register action handlers | 17 | // Register action handlers |
18 | this.actions.news.hide.listen(this._hide.bind(this)); | 18 | this.actions.news.hide.listen(this._hide.bind(this)); |
19 | this.actions.user.logout.listen(this._resetNewsRequest.bind(this)); | ||
19 | } | 20 | } |
20 | 21 | ||
21 | setup() { | 22 | setup() { |
@@ -40,4 +41,15 @@ export default class NewsStore extends Store { | |||
40 | remove(result, n => n.id === newsId); | 41 | remove(result, n => n.id === newsId); |
41 | }); | 42 | }); |
42 | } | 43 | } |
44 | |||
45 | /** | ||
46 | * Reset the news request when current user logs out so that when another user | ||
47 | * logs in again without an app restart, the request will be fetched again and | ||
48 | * the news will be shown to the user. | ||
49 | * | ||
50 | * @private | ||
51 | */ | ||
52 | _resetNewsRequest() { | ||
53 | this.latestNewsRequest.reset(); | ||
54 | } | ||
43 | } | 55 | } |