Skip to content

Commit 52c131d

Browse files
authored
refactor based on the configLocation changes
1 parent 9ff65fe commit 52c131d

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

main.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const {
99
Menu
1010
} = require('electron');
1111
const windowStateKeeper = require('electron-window-state');
12-
const Configuration = require('./app/public/js/common/configLocation');
12+
const configuration = require('./app/public/js/common/configLocation');
1313

1414
// custom constants
1515
const clientId = '342b8a7af638944906dcdb46f9d56d98';
@@ -24,9 +24,9 @@ app.on('ready', () => {
2424
});
2525

2626
function checkUserConfig() {
27-
const userConfigExists = Configuration.configExists;
27+
const containsConfig = configuration.containsConfig();
2828

29-
if (userConfigExists) {
29+
if (containsConfig) {
3030
initMainWindow();
3131
} else {
3232
authenticateUser();
@@ -71,7 +71,7 @@ function authenticateUser() {
7171
}
7272

7373
function setUserData(accessToken) {
74-
fs.writeFileSync(Configuration.path, JSON.stringify({
74+
fs.writeFileSync(configuration.getPath(), JSON.stringify({
7575
accessToken: accessToken,
7676
clientId: clientId
7777
}), 'utf-8');
@@ -263,4 +263,4 @@ function menuBar() {
263263

264264
const menu = Menu.buildFromTemplate(template);
265265
Menu.setApplicationMenu(menu)
266-
}
266+
}

0 commit comments

Comments
 (0)