aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatar Dominik Guzei <dominik.guzei@gmail.com>2019-05-22 17:27:37 +0200
committerLibravatar Dominik Guzei <dominik.guzei@gmail.com>2019-05-22 17:27:37 +0200
commit7e9a50ab85e641d2d76b2451718c5d666d13d273 (patch)
treeac5425b3dd8a85a54bd944e01827b207078089c2 /src
parentMerge pull request #1425 from meetfranz/fix/workspace-services-ordering-bug (diff)
downloadferdium-app-7e9a50ab85e641d2d76b2451718c5d666d13d273.tar.gz
ferdium-app-7e9a50ab85e641d2d76b2451718c5d666d13d273.tar.zst
ferdium-app-7e9a50ab85e641d2d76b2451718c5d666d13d273.zip
support multilingual announcements
Diffstat (limited to 'src')
-rw-r--r--src/features/announcements/store.js14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/features/announcements/store.js b/src/features/announcements/store.js
index 0d2b68ccf..ad78a0979 100644
--- a/src/features/announcements/store.js
+++ b/src/features/announcements/store.js
@@ -29,7 +29,15 @@ export class AnnouncementsStore extends FeatureStore {
29 } 29 }
30 30
31 @computed get announcement() { 31 @computed get announcement() {
32 return getAnnouncementRequest.result; 32 if (!this.stores || !getAnnouncementRequest.result) return null;
33 const { locale, defaultLocale } = this.stores.app;
34 const announcement = getAnnouncementRequest.result;
35 // User locale
36 if (announcement[locale]) return announcement[locale];
37 // Default locale
38 if (announcement[defaultLocale]) return announcement[defaultLocale];
39 // No locales specified
40 return announcement;
33 } 41 }
34 42
35 @computed get areNewsAvailable() { 43 @computed get areNewsAvailable() {
@@ -121,8 +129,8 @@ export class AnnouncementsStore extends FeatureStore {
121 _fetchAnnouncements = () => { 129 _fetchAnnouncements = () => {
122 const targetVersion = this.targetVersion || this.currentVersion; 130 const targetVersion = this.targetVersion || this.currentVersion;
123 if (!targetVersion) return; 131 if (!targetVersion) return;
124 getChangelogRequest.execute(targetVersion); 132 getChangelogRequest.reset().execute(targetVersion);
125 getAnnouncementRequest.execute(targetVersion); 133 getAnnouncementRequest.reset().execute(targetVersion);
126 }; 134 };
127 135
128 _showAnnouncementOnRouteMatch = () => { 136 _showAnnouncementOnRouteMatch = () => {