aboutsummaryrefslogtreecommitdiffstats
path: root/src/electron/Settings.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/electron/Settings.js')
-rw-r--r--src/electron/Settings.js10
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 @@
1import { observable, toJS } from 'mobx'; 1import { observable, toJS } from 'mobx';
2import { pathExistsSync, outputJsonSync, readJsonSync } from 'fs-extra'; 2import { pathExistsSync, outputJsonSync, readJsonSync } from 'fs-extra';
3import path from 'path'; 3import { userDataPath } from '../environment';
4
5import { SETTINGS_PATH } from '../environment';
6 4
7const debug = require('debug')('Ferdi:Settings'); 5const 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}