aboutsummaryrefslogtreecommitdiffstats
path: root/src/stores
diff options
context:
space:
mode:
authorLibravatar vantezzen <hello@vantezzen.io>2019-10-27 10:17:47 +0100
committerLibravatar vantezzen <hello@vantezzen.io>2019-10-27 10:17:47 +0100
commita0ac009c44b210df4d79ffedbdd892fe7302d22e (patch)
treee74b4aa156a6da0311d5fe82b954ea76723c4919 /src/stores
parentImprove hero picture (diff)
downloadferdium-app-a0ac009c44b210df4d79ffedbdd892fe7302d22e.tar.gz
ferdium-app-a0ac009c44b210df4d79ffedbdd892fe7302d22e.tar.zst
ferdium-app-a0ac009c44b210df4d79ffedbdd892fe7302d22e.zip
#146 Add possible fix for 1.1.1.1 hack
Diffstat (limited to 'src/stores')
-rw-r--r--src/stores/AppStore.js4
-rw-r--r--src/stores/FeaturesStore.js5
-rw-r--r--src/stores/UserStore.js13
-rw-r--r--src/stores/lib/CachedRequest.js4
4 files changed, 20 insertions, 6 deletions
diff --git a/src/stores/AppStore.js b/src/stores/AppStore.js
index 894c19347..124c117b0 100644
--- a/src/stores/AppStore.js
+++ b/src/stores/AppStore.js
@@ -181,7 +181,9 @@ export default class AppStore extends Store {
181 181
182 this.locale = this._getDefaultLocale(); 182 this.locale = this._getDefaultLocale();
183 183
184 this._healthCheck(); 184 setTimeout(() => {
185 this._healthCheck();
186 }, 1000);
185 187
186 this.isSystemDarkModeEnabled = systemPreferences.isDarkMode(); 188 this.isSystemDarkModeEnabled = systemPreferences.isDarkMode();
187 189
diff --git a/src/stores/FeaturesStore.js b/src/stores/FeaturesStore.js
index ab5d762c7..780cde3a7 100644
--- a/src/stores/FeaturesStore.js
+++ b/src/stores/FeaturesStore.js
@@ -57,7 +57,10 @@ export default class FeaturesStore extends Store {
57 _updateFeatures = () => { 57 _updateFeatures = () => {
58 const features = Object.assign({}, DEFAULT_FEATURES_CONFIG); 58 const features = Object.assign({}, DEFAULT_FEATURES_CONFIG);
59 if (this.stores.user.isLoggedIn) { 59 if (this.stores.user.isLoggedIn) {
60 const requestResult = this.featuresRequest.execute().result; 60 let requestResult = {};
61 try {
62 requestResult = this.featuresRequest.execute().result;
63 } catch (e) {} // eslint-disable-line no-empty
61 Object.assign(features, requestResult); 64 Object.assign(features, requestResult);
62 } 65 }
63 runInAction('FeaturesStore::_updateFeatures', () => { 66 runInAction('FeaturesStore::_updateFeatures', () => {
diff --git a/src/stores/UserStore.js b/src/stores/UserStore.js
index d6a2e5fde..ec0b0cf8d 100644
--- a/src/stores/UserStore.js
+++ b/src/stores/UserStore.js
@@ -348,7 +348,12 @@ export default class UserStore extends Store {
348 // Reactions 348 // Reactions
349 async _getUserData() { 349 async _getUserData() {
350 if (this.isLoggedIn) { 350 if (this.isLoggedIn) {
351 const data = await this.getUserInfoRequest.execute()._promise; 351 let data;
352 try {
353 data = await this.getUserInfoRequest.execute()._promise;
354 } catch (e) {
355 return false;
356 }
352 357
353 // We need to set the beta flag for the SettingsStore 358 // We need to set the beta flag for the SettingsStore
354 this.actions.settings.update({ 359 this.actions.settings.update({
@@ -408,7 +413,11 @@ export default class UserStore extends Store {
408 } 413 }
409 414
410 async _migrateUserLocale() { 415 async _migrateUserLocale() {
411 await this.getUserInfoRequest._promise; 416 try {
417 await this.getUserInfoRequest._promise;
418 } catch (e) {
419 return false;
420 }
412 421
413 if (!this.data.locale) { 422 if (!this.data.locale) {
414 debug('Migrate "locale" to user data'); 423 debug('Migrate "locale" to user data');
diff --git a/src/stores/lib/CachedRequest.js b/src/stores/lib/CachedRequest.js
index ac8b2bd81..31c7ce241 100644
--- a/src/stores/lib/CachedRequest.js
+++ b/src/stores/lib/CachedRequest.js
@@ -39,7 +39,7 @@ export default class CachedRequest extends Request {
39 }), 0); 39 }), 0);
40 40
41 // Issue api call & save it as promise that is handled to update the results of the operation 41 // Issue api call & save it as promise that is handled to update the results of the operation
42 this._promise = new Promise((resolve, reject) => { 42 this._promise = new Promise((resolve) => {
43 this._api[this._method](...callArgs) 43 this._api[this._method](...callArgs)
44 .then((result) => { 44 .then((result) => {
45 setTimeout(action(() => { 45 setTimeout(action(() => {
@@ -63,7 +63,7 @@ export default class CachedRequest extends Request {
63 this.wasExecuted = true; 63 this.wasExecuted = true;
64 this._isWaitingForResponse = false; 64 this._isWaitingForResponse = false;
65 this._triggerHooks(); 65 this._triggerHooks();
66 reject(error); 66 // reject(error);
67 }), 1); 67 }), 1);
68 })); 68 }));
69 }); 69 });