aboutsummaryrefslogtreecommitdiffstats
path: root/src/electron/Settings.js
diff options
context:
space:
mode:
authorLibravatar Vijay Raghavan Aravamudhan <vraravam@users.noreply.github.com>2021-08-08 00:01:37 +0000
committerLibravatar GitHub <noreply@github.com>2021-08-08 05:31:37 +0530
commit97d51a7763b14c92ee71ff9a012311dd9498d803 (patch)
treebd36005031ecb1148f27aa541e7a92a5e3aa4c0c /src/electron/Settings.js
parent5.6.1-nightly.17 [skip ci] (diff)
downloadferdium-app-97d51a7763b14c92ee71ff9a012311dd9498d803.tar.gz
ferdium-app-97d51a7763b14c92ee71ff9a012311dd9498d803.tar.zst
ferdium-app-97d51a7763b14c92ee71ff9a012311dd9498d803.zip
refactor: path-references refactoring and using 'import' instead of 'require' (#1752)
* refactor references to 'userData' and 'appData' directories to move hardcoding into single location * convert to es6 for lower memory usage as per https://codesource.io/the-difference-between-import-and-require-in-javascript/
Diffstat (limited to 'src/electron/Settings.js')
-rw-r--r--src/electron/Settings.js6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/electron/Settings.js b/src/electron/Settings.js
index 2f3f8261a..4dd9f8245 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
@@ -58,6 +56,6 @@ export default class Settings {
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}