aboutsummaryrefslogtreecommitdiffstats
path: root/src/stores/AppStore.ts
diff options
context:
space:
mode:
authorLibravatar Ricardo Cino <ricardo@cino.io>2022-07-07 09:31:50 +0200
committerLibravatar GitHub <noreply@github.com>2022-07-07 09:31:50 +0200
commit71c52373f81cace664047edd19d9d289f45a4dff (patch)
tree69b3f1d45a8b3f1ceab9497ea3c96e9dc18e3166 /src/stores/AppStore.ts
parent6.0.0-nightly.91 [skip ci] (diff)
downloadferdium-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.ts6
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';
10import { action, computed, observable } from 'mobx'; 10import { action, computed, makeObservable, observable } from 'mobx';
11import moment from 'moment'; 11import moment from 'moment';
12import AutoLaunch from 'auto-launch'; 12import AutoLaunch from 'auto-launch';
13import ms from 'ms'; 13import 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();