aboutsummaryrefslogtreecommitdiffstats
path: root/src/stores/SettingsStore.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/SettingsStore.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/SettingsStore.ts')
-rw-r--r--src/stores/SettingsStore.ts7
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
1import { ipcRenderer } from 'electron'; 2import { ipcRenderer } from 'electron';
2import { getCurrentWindow } from '@electron/remote'; 3import { getCurrentWindow } from '@electron/remote';
3import { action, computed, observable, reaction } from 'mobx'; 4import { action, computed, makeObservable, observable, reaction } from 'mobx';
4import localStorage from 'mobx-localstorage'; 5import localStorage from 'mobx-localstorage';
5import { Stores } from '../@types/stores.types'; 6import { Stores } from '../@types/stores.types';
6import { ApiInterface } from '../api'; 7import { 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));