diff options
author | Ricardo Cino <ricardo@cino.io> | 2022-07-07 09:31:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-07 09:31:50 +0200 |
commit | 71c52373f81cace664047edd19d9d289f45a4dff (patch) | |
tree | 69b3f1d45a8b3f1ceab9497ea3c96e9dc18e3166 /src/stores/AppStore.ts | |
parent | 6.0.0-nightly.91 [skip ci] (diff) | |
download | ferdium-app-71c52373f81cace664047edd19d9d289f45a4dff.tar.gz ferdium-app-71c52373f81cace664047edd19d9d289f45a4dff.tar.zst ferdium-app-71c52373f81cace664047edd19d9d289f45a4dff.zip |
chore: Mobx & React-Router upgrade (#406)
Co-authored-by: Vijay A <vraravam@users.noreply.github.com>
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(); |