diff options
author | Vijay A <avijayr@protonmail.com> | 2021-08-13 00:45:01 +0530 |
---|---|---|
committer | Vijay A <avijayr@protonmail.com> | 2021-08-13 00:45:01 +0530 |
commit | 2d27d5e66649d4f5baf127a53ee5ae524eae3a59 (patch) | |
tree | c592ea219ac8cd987fc367f57b54034c450ab2ab /src/electron/Settings.js | |
parent | Ferdi v5.6.0 (diff) | |
parent | 5.6.1-nightly.24 [skip ci] (diff) | |
download | ferdium-app-2d27d5e66649d4f5baf127a53ee5ae524eae3a59.tar.gz ferdium-app-2d27d5e66649d4f5baf127a53ee5ae524eae3a59.tar.zst ferdium-app-2d27d5e66649d4f5baf127a53ee5ae524eae3a59.zip |
chore: merge from nightly branch into release branch in prep for next beta
Diffstat (limited to 'src/electron/Settings.js')
-rw-r--r-- | src/electron/Settings.js | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/electron/Settings.js b/src/electron/Settings.js index 2f3f8261a..3e11bb175 100644 --- a/src/electron/Settings.js +++ b/src/electron/Settings.js | |||
@@ -1,8 +1,6 @@ | |||
1 | import { observable, toJS } from 'mobx'; | 1 | import { observable, toJS } from 'mobx'; |
2 | import { pathExistsSync, outputJsonSync, readJsonSync } from 'fs-extra'; | 2 | import { pathExistsSync, outputJsonSync, readJsonSync } from 'fs-extra'; |
3 | import path from 'path'; | 3 | import { userDataPath } from '../environment'; |
4 | |||
5 | import { SETTINGS_PATH } from '../environment'; | ||
6 | 4 | ||
7 | const debug = require('debug')('Ferdi:Settings'); | 5 | const debug = require('debug')('Ferdi:Settings'); |
8 | 6 | ||
@@ -47,17 +45,17 @@ export default class Settings { | |||
47 | 45 | ||
48 | _hydrate() { | 46 | _hydrate() { |
49 | this.store = this._merge(readJsonSync(this.settingsFile)); | 47 | this.store = this._merge(readJsonSync(this.settingsFile)); |
50 | debug('Hydrate store', this.type, toJS(this.store)); | 48 | debug('Hydrate store', this.type, this.allSerialized); |
51 | } | 49 | } |
52 | 50 | ||
53 | _writeFile() { | 51 | _writeFile() { |
54 | outputJsonSync(this.settingsFile, this.store, { | 52 | outputJsonSync(this.settingsFile, this.store, { |
55 | spaces: 2, | 53 | spaces: 2, |
56 | }); | 54 | }); |
57 | debug('Write settings file', this.type, toJS(this.store)); | 55 | debug('Write settings file', this.type, this.allSerialized); |
58 | } | 56 | } |
59 | 57 | ||
60 | get settingsFile() { | 58 | get settingsFile() { |
61 | return path.join(SETTINGS_PATH, `${this.type === 'app' ? 'settings' : this.type}.json`); | 59 | return userDataPath('config', `${this.type === 'app' ? 'settings' : this.type}.json`); |
62 | } | 60 | } |
63 | } | 61 | } |