From 97d51a7763b14c92ee71ff9a012311dd9498d803 Mon Sep 17 00:00:00 2001 From: Vijay Raghavan Aravamudhan Date: Sun, 8 Aug 2021 00:01:37 +0000 Subject: 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/ --- src/stores/AppStore.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/stores/AppStore.js') 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'; import AutoLaunch from 'auto-launch'; import ms from 'ms'; import { URL } from 'url'; -import path from 'path'; import { readJsonSync } from 'fs-extra'; import Store from './lib/Store'; @@ -24,6 +23,7 @@ import { ferdiVersion, electronVersion, osRelease, + userDataPath, } from '../environment'; import locales from '../i18n/translations'; import { onVisibilityChange } from '../helpers/visibility-helper'; @@ -307,9 +307,7 @@ export default class AppStore extends Store { id: workspace.id, services: workspace.services, })), - windowSettings: readJsonSync( - path.join(app.getPath('userData'), 'window-state.json'), - ), + windowSettings: readJsonSync(userDataPath('window-state.json')), settings, features: this.stores.features.features, user: this.stores.user.data.id, -- cgit v1.2.3-70-g09d2