aboutsummaryrefslogtreecommitdiffstats
path: root/src/stores/AppStore.ts
diff options
context:
space:
mode:
authorLibravatar André Oliveira <37463445+SpecialAro@users.noreply.github.com>2022-08-04 00:12:03 +0100
committerLibravatar GitHub <noreply@github.com>2022-08-03 23:12:03 +0000
commitc2509e860752e23812bb408e331c02c918aadd54 (patch)
treeb855163ad1bddaaa19c47a9cea2713c6899ea1a5 /src/stores/AppStore.ts
parentRevert to older working version of 'macos-notification-state' (diff)
downloadferdium-app-c2509e860752e23812bb408e331c02c918aadd54.tar.gz
ferdium-app-c2509e860752e23812bb408e331c02c918aadd54.tar.zst
ferdium-app-c2509e860752e23812bb408e331c02c918aadd54.zip
chore: change values inside mobx actions to fix console warnings (#532)
Diffstat (limited to 'src/stores/AppStore.ts')
-rw-r--r--src/stores/AppStore.ts22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/stores/AppStore.ts b/src/stores/AppStore.ts
index af1a0daae..08d2f718c 100644
--- a/src/stores/AppStore.ts
+++ b/src/stores/AppStore.ts
@@ -503,6 +503,17 @@ export default class AppStore extends TypedStore {
503 this.isClearingAllCache = false; 503 this.isClearingAllCache = false;
504 } 504 }
505 505
506 @action _setLocale() {
507 if (this.stores.user?.isLoggedIn && this.stores.user?.data.locale) {
508 this.locale = this.stores.user.data.locale;
509 } else if (!this.locale) {
510 this.locale = this._getDefaultLocale();
511 }
512
513 moment.locale(this.locale);
514 debug(`Set locale to "${this.locale}"`);
515 }
516
506 // Reactions 517 // Reactions
507 _offlineCheck() { 518 _offlineCheck() {
508 if (!this.isOnline) { 519 if (!this.isOnline) {
@@ -516,17 +527,6 @@ export default class AppStore extends TypedStore {
516 } 527 }
517 } 528 }
518 529
519 _setLocale() {
520 if (this.stores.user?.isLoggedIn && this.stores.user?.data.locale) {
521 this.locale = this.stores.user.data.locale;
522 } else if (!this.locale) {
523 this.locale = this._getDefaultLocale();
524 }
525
526 moment.locale(this.locale);
527 debug(`Set locale to "${this.locale}"`);
528 }
529
530 _getDefaultLocale() { 530 _getDefaultLocale() {
531 return getLocale({ 531 return getLocale({
532 locale: ferdiumLocale, 532 locale: ferdiumLocale,