diff options
Diffstat (limited to 'src/stores/AppStore.ts')
-rw-r--r-- | src/stores/AppStore.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/stores/AppStore.ts b/src/stores/AppStore.ts index 0ecfdb7c0..ed6d0e263 100644 --- a/src/stores/AppStore.ts +++ b/src/stores/AppStore.ts | |||
@@ -7,7 +7,7 @@ import { | |||
7 | getCurrentWindow, | 7 | getCurrentWindow, |
8 | process as remoteProcess, | 8 | process as remoteProcess, |
9 | } from '@electron/remote'; | 9 | } from '@electron/remote'; |
10 | import { action, computed, observable } from 'mobx'; | 10 | import { action, computed, makeObservable, observable } from 'mobx'; |
11 | import moment from 'moment'; | 11 | import moment from 'moment'; |
12 | import AutoLaunch from 'auto-launch'; | 12 | import AutoLaunch from 'auto-launch'; |
13 | import ms from 'ms'; | 13 | import ms from 'ms'; |
@@ -105,6 +105,8 @@ export default class AppStore extends TypedStore { | |||
105 | constructor(stores: Stores, api: ApiInterface, actions: Actions) { | 105 | constructor(stores: Stores, api: ApiInterface, actions: Actions) { |
106 | super(stores, api, actions); | 106 | super(stores, api, actions); |
107 | 107 | ||
108 | makeObservable(this); | ||
109 | |||
108 | // Register action handlers | 110 | // Register action handlers |
109 | this.actions.app.notify.listen(this._notify.bind(this)); | 111 | this.actions.app.notify.listen(this._notify.bind(this)); |
110 | this.actions.app.setBadge.listen(this._setBadge.bind(this)); | 112 | this.actions.app.setBadge.listen(this._setBadge.bind(this)); |
@@ -510,7 +512,7 @@ export default class AppStore extends TypedStore { | |||
510 | } | 512 | } |
511 | 513 | ||
512 | _setLocale() { | 514 | _setLocale() { |
513 | if (this.stores.user.isLoggedIn && this.stores.user.data.locale) { | 515 | if (this.stores.user?.isLoggedIn && this.stores.user?.data.locale) { |
514 | this.locale = this.stores.user.data.locale; | 516 | this.locale = this.stores.user.data.locale; |
515 | } else if (!this.locale) { | 517 | } else if (!this.locale) { |
516 | this.locale = this._getDefaultLocale(); | 518 | this.locale = this._getDefaultLocale(); |