diff options
Diffstat (limited to 'src/features')
-rw-r--r-- | src/features/announcements/store.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/features/announcements/store.js b/src/features/announcements/store.js index aa98d3bd1..7ecc0e346 100644 --- a/src/features/announcements/store.js +++ b/src/features/announcements/store.js | |||
@@ -34,6 +34,12 @@ export class AnnouncementsStore extends FeatureStore { | |||
34 | return getAnnouncementRequest.result; | 34 | return getAnnouncementRequest.result; |
35 | } | 35 | } |
36 | 36 | ||
37 | @computed get areNewsAvailable() { | ||
38 | const isChangelogAvailable = getChangelogRequest.wasExecuted && !!this.changelog; | ||
39 | const isAnnouncementAvailable = getAnnouncementRequest.wasExecuted && !!this.announcement; | ||
40 | return isChangelogAvailable || isAnnouncementAvailable; | ||
41 | } | ||
42 | |||
37 | @computed get settings() { | 43 | @computed get settings() { |
38 | return localStorage.getItem(LOCAL_STORAGE_KEY) || {}; | 44 | return localStorage.getItem(LOCAL_STORAGE_KEY) || {}; |
39 | } | 45 | } |
@@ -87,6 +93,7 @@ export class AnnouncementsStore extends FeatureStore { | |||
87 | // ======= ACTIONS ======= // | 93 | // ======= ACTIONS ======= // |
88 | 94 | ||
89 | @action _showAnnouncement = ({ targetVersion } = {}) => { | 95 | @action _showAnnouncement = ({ targetVersion } = {}) => { |
96 | if (!this.areNewsAvailable) return; | ||
90 | this.targetVersion = targetVersion || this.currentVersion; | 97 | this.targetVersion = targetVersion || this.currentVersion; |
91 | this.isAnnouncementVisible = true; | 98 | this.isAnnouncementVisible = true; |
92 | this.actions.service.blurActive(); | 99 | this.actions.service.blurActive(); |