diff options
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 | } |