diff options
author | André Oliveira <37463445+SpecialAro@users.noreply.github.com> | 2022-08-19 10:06:41 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-19 10:06:41 +0100 |
commit | bd52ed239c098649f85138c6276368761d92fc54 (patch) | |
tree | c7451c10a1655eace397f9a341e947db7169e8fc /src/stores | |
parent | 6.0.1-nightly.17 [skip ci] (diff) | |
download | ferdium-app-bd52ed239c098649f85138c6276368761d92fc54.tar.gz ferdium-app-bd52ed239c098649f85138c6276368761d92fc54.tar.zst ferdium-app-bd52ed239c098649f85138c6276368761d92fc54.zip |
fix: change locale not working (#561)
fix: locale not changing
Diffstat (limited to 'src/stores')
-rw-r--r-- | src/stores/AppStore.ts | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/stores/AppStore.ts b/src/stores/AppStore.ts index 08d2f718c..aab279e59 100644 --- a/src/stores/AppStore.ts +++ b/src/stores/AppStore.ts | |||
@@ -503,11 +503,15 @@ export default class AppStore extends TypedStore { | |||
503 | this.isClearingAllCache = false; | 503 | this.isClearingAllCache = false; |
504 | } | 504 | } |
505 | 505 | ||
506 | @action _setLocale() { | 506 | @action _changeLocale(value: string) { |
507 | this.locale = value; | ||
508 | } | ||
509 | |||
510 | _setLocale() { | ||
507 | if (this.stores.user?.isLoggedIn && this.stores.user?.data.locale) { | 511 | if (this.stores.user?.isLoggedIn && this.stores.user?.data.locale) { |
508 | this.locale = this.stores.user.data.locale; | 512 | this._changeLocale(this.stores.user.data.locale); |
509 | } else if (!this.locale) { | 513 | } else if (!this.locale) { |
510 | this.locale = this._getDefaultLocale(); | 514 | this._changeLocale(this._getDefaultLocale()); |
511 | } | 515 | } |
512 | 516 | ||
513 | moment.locale(this.locale); | 517 | moment.locale(this.locale); |