mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-01-03 12:47:13 -06:00
Electron-308
1. Changed args name 2. Fixed copy config method
This commit is contained in:
parent
a07ac4ed8a
commit
20c3368272
@ -34,8 +34,8 @@ describe('Tests for Always on top', () => {
|
||||
return require('electron').remote.app.getPath('userData');
|
||||
})
|
||||
});
|
||||
app.client.getUserDataPath().then((path) => {
|
||||
resolve(path.value + '/Symphony.config')
|
||||
app.client.getUserDataPath().then((userConfigPath) => {
|
||||
resolve(userConfigPath.value + '/Symphony.config')
|
||||
}).catch((err) => {
|
||||
reject(err);
|
||||
});
|
||||
|
@ -37,8 +37,8 @@ describe('Tests for Full screen', () => {
|
||||
return require('electron').remote.app.getPath('userData');
|
||||
})
|
||||
});
|
||||
app.client.getUserDataPath().then((path) => {
|
||||
resolve(path.value + '/Symphony.config')
|
||||
app.client.getUserDataPath().then((userConfigPath) => {
|
||||
resolve(userConfigPath.value + '/Symphony.config')
|
||||
}).catch((err) => {
|
||||
reject(err);
|
||||
});
|
||||
|
@ -37,8 +37,8 @@ describe('Tests for Minimize on Close', () => {
|
||||
return require('electron').remote.app.getPath('userData');
|
||||
})
|
||||
});
|
||||
app.client.getUserDataPath().then((path) => {
|
||||
resolve(path.value + '/Symphony.config')
|
||||
app.client.getUserDataPath().then((userConfigPath) => {
|
||||
resolve(userConfigPath.value + '/Symphony.config')
|
||||
}).catch((err) => {
|
||||
reject(err);
|
||||
});
|
||||
|
@ -44,7 +44,16 @@ class App {
|
||||
static readConfig(configPath) {
|
||||
|
||||
if (!fs.existsSync(configPath)) {
|
||||
return this.copyConfigPath();
|
||||
return new Promise(function (resolve) {
|
||||
this.copyConfigPath().then(() => {
|
||||
fs.readFile(configPath, 'utf-8', function (err, data) {
|
||||
if (err) {
|
||||
throw new Error("Unable to read user config file " + err);
|
||||
}
|
||||
resolve(JSON.parse(data));
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
return new Promise(function (resolve) {
|
||||
|
@ -37,8 +37,8 @@ describe('Tests for Zoom in and Zoom out', () => {
|
||||
return require('electron').remote.app.getPath('userData');
|
||||
})
|
||||
});
|
||||
app.client.getUserDataPath().then((path) => {
|
||||
resolve(path.value + '/Symphony.config')
|
||||
app.client.getUserDataPath().then((userConfigPath) => {
|
||||
resolve(userConfigPath.value + '/Symphony.config')
|
||||
}).catch((err) => {
|
||||
reject(err);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user