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/SettingsStore.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/SettingsStore.ts')
-rw-r--r-- | src/stores/SettingsStore.ts | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/stores/SettingsStore.ts b/src/stores/SettingsStore.ts index 0296ba0e7..a03d3c188 100644 --- a/src/stores/SettingsStore.ts +++ b/src/stores/SettingsStore.ts | |||
@@ -1,6 +1,7 @@ | |||
1 | |||
1 | import { ipcRenderer } from 'electron'; | 2 | import { ipcRenderer } from 'electron'; |
2 | import { getCurrentWindow } from '@electron/remote'; | 3 | import { getCurrentWindow } from '@electron/remote'; |
3 | import { action, computed, observable, reaction } from 'mobx'; | 4 | import { action, computed, makeObservable, observable, reaction } from 'mobx'; |
4 | import localStorage from 'mobx-localstorage'; | 5 | import localStorage from 'mobx-localstorage'; |
5 | import { Stores } from '../@types/stores.types'; | 6 | import { Stores } from '../@types/stores.types'; |
6 | import { ApiInterface } from '../api'; | 7 | import { ApiInterface } from '../api'; |
@@ -22,7 +23,7 @@ export default class SettingsStore extends TypedStore { | |||
22 | 'updateAppSettings', | 23 | 'updateAppSettings', |
23 | ); | 24 | ); |
24 | 25 | ||
25 | loaded = false; | 26 | @observable loaded: boolean = false; |
26 | 27 | ||
27 | fileSystemSettingsTypes = FILE_SYSTEM_SETTINGS_TYPES; | 28 | fileSystemSettingsTypes = FILE_SYSTEM_SETTINGS_TYPES; |
28 | 29 | ||
@@ -34,6 +35,8 @@ export default class SettingsStore extends TypedStore { | |||
34 | constructor(stores: Stores, api: ApiInterface, actions: Actions) { | 35 | constructor(stores: Stores, api: ApiInterface, actions: Actions) { |
35 | super(stores, api, actions); | 36 | super(stores, api, actions); |
36 | 37 | ||
38 | makeObservable(this); | ||
39 | |||
37 | // Register action handlers | 40 | // Register action handlers |
38 | this.actions.settings.update.listen(this._update.bind(this)); | 41 | this.actions.settings.update.listen(this._update.bind(this)); |
39 | this.actions.settings.remove.listen(this._remove.bind(this)); | 42 | this.actions.settings.remove.listen(this._remove.bind(this)); |