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/stores/AppStore.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/stores/AppStore.js')
-rw-r--r-- | src/stores/AppStore.js | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/stores/AppStore.js b/src/stores/AppStore.js index 6b5ca7c9a..1d706f1ef 100644 --- a/src/stores/AppStore.js +++ b/src/stores/AppStore.js | |||
@@ -12,7 +12,6 @@ import moment from 'moment'; | |||
12 | import AutoLaunch from 'auto-launch'; | 12 | import AutoLaunch from 'auto-launch'; |
13 | import ms from 'ms'; | 13 | import ms from 'ms'; |
14 | import { URL } from 'url'; | 14 | import { URL } from 'url'; |
15 | import path from 'path'; | ||
16 | import { readJsonSync } from 'fs-extra'; | 15 | import { readJsonSync } from 'fs-extra'; |
17 | 16 | ||
18 | import Store from './lib/Store'; | 17 | import Store from './lib/Store'; |
@@ -24,6 +23,7 @@ import { | |||
24 | ferdiVersion, | 23 | ferdiVersion, |
25 | electronVersion, | 24 | electronVersion, |
26 | osRelease, | 25 | osRelease, |
26 | userDataPath, | ||
27 | } from '../environment'; | 27 | } from '../environment'; |
28 | import locales from '../i18n/translations'; | 28 | import locales from '../i18n/translations'; |
29 | import { onVisibilityChange } from '../helpers/visibility-helper'; | 29 | import { onVisibilityChange } from '../helpers/visibility-helper'; |
@@ -307,9 +307,7 @@ export default class AppStore extends Store { | |||
307 | id: workspace.id, | 307 | id: workspace.id, |
308 | services: workspace.services, | 308 | services: workspace.services, |
309 | })), | 309 | })), |
310 | windowSettings: readJsonSync( | 310 | windowSettings: readJsonSync(userDataPath('window-state.json')), |
311 | path.join(app.getPath('userData'), 'window-state.json'), | ||
312 | ), | ||
313 | settings, | 311 | settings, |
314 | features: this.stores.features.features, | 312 | features: this.stores.features.features, |
315 | user: this.stores.user.data.id, | 313 | user: this.stores.user.data.id, |