diff options
author | Vijay Raghavan Aravamudhan <vraravam@users.noreply.github.com> | 2021-08-08 00:01:37 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-08 05:31:37 +0530 |
commit | 97d51a7763b14c92ee71ff9a012311dd9498d803 (patch) | |
tree | bd36005031ecb1148f27aa541e7a92a5e3aa4c0c /src/electron/Settings.js | |
parent | 5.6.1-nightly.17 [skip ci] (diff) | |
download | ferdium-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.js | 6 |
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 @@ | |||
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 | ||
@@ -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 | } |