aboutsummaryrefslogtreecommitdiffstats
path: root/src/stores/NewsStore.js
diff options
context:
space:
mode:
authorLibravatar Amine Mouafik <amine@mouafik.fr>2019-07-01 13:39:55 +0700
committerLibravatar Amine Mouafik <amine@mouafik.fr>2019-07-01 13:39:55 +0700
commitb43b265e8d383eb9b6f0a31f096f52ad9f7171c2 (patch)
tree6b258426b849520ae29d92a44fe2aa7c608ad80b /src/stores/NewsStore.js
parentAdd features list to README (diff)
parentRevert: fix spellchecker (diff)
downloadferdium-app-b43b265e8d383eb9b6f0a31f096f52ad9f7171c2.tar.gz
ferdium-app-b43b265e8d383eb9b6f0a31f096f52ad9f7171c2.tar.zst
ferdium-app-b43b265e8d383eb9b6f0a31f096f52ad9f7171c2.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'src/stores/NewsStore.js')
-rw-r--r--src/stores/NewsStore.js12
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}