diff options
Diffstat (limited to 'src/stores/AppStore.ts')
-rw-r--r-- | src/stores/AppStore.ts | 22 |
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, |