From bd52ed239c098649f85138c6276368761d92fc54 Mon Sep 17 00:00:00 2001 From: André Oliveira <37463445+SpecialAro@users.noreply.github.com> Date: Fri, 19 Aug 2022 10:06:41 +0100 Subject: fix: change locale not working (#561) fix: locale not changing --- src/stores/AppStore.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/stores/AppStore.ts') 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 { this.isClearingAllCache = false; } - @action _setLocale() { + @action _changeLocale(value: string) { + this.locale = value; + } + + _setLocale() { if (this.stores.user?.isLoggedIn && this.stores.user?.data.locale) { - this.locale = this.stores.user.data.locale; + this._changeLocale(this.stores.user.data.locale); } else if (!this.locale) { - this.locale = this._getDefaultLocale(); + this._changeLocale(this._getDefaultLocale()); } moment.locale(this.locale); -- cgit v1.2.3-54-g00ecf