From c2509e860752e23812bb408e331c02c918aadd54 Mon Sep 17 00:00:00 2001 From: André Oliveira <37463445+SpecialAro@users.noreply.github.com> Date: Thu, 4 Aug 2022 00:12:03 +0100 Subject: chore: change values inside mobx actions to fix console warnings (#532) --- src/stores/AppStore.ts | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/stores/AppStore.ts') 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 { this.isClearingAllCache = false; } + @action _setLocale() { + if (this.stores.user?.isLoggedIn && this.stores.user?.data.locale) { + this.locale = this.stores.user.data.locale; + } else if (!this.locale) { + this.locale = this._getDefaultLocale(); + } + + moment.locale(this.locale); + debug(`Set locale to "${this.locale}"`); + } + // Reactions _offlineCheck() { if (!this.isOnline) { @@ -516,17 +527,6 @@ export default class AppStore extends TypedStore { } } - _setLocale() { - if (this.stores.user?.isLoggedIn && this.stores.user?.data.locale) { - this.locale = this.stores.user.data.locale; - } else if (!this.locale) { - this.locale = this._getDefaultLocale(); - } - - moment.locale(this.locale); - debug(`Set locale to "${this.locale}"`); - } - _getDefaultLocale() { return getLocale({ locale: ferdiumLocale, -- cgit v1.2.3-70-g09d2