#22: Display error if daemon version is too low

This commit is contained in:
Scott E. Graves
2019-05-24 12:38:31 -05:00
parent 200534dccd
commit 234785180a
3 changed files with 79 additions and 7 deletions

View File

@@ -278,6 +278,44 @@ ipcMain.on(Constants.IPC_Browse_Directory + '_sync', (event, data) => {
});
});
ipcMain.on(Constants.IPC_Check_Daemon_Version, (event, data) => {
const dataDirectory = helpers.resolvePath(data.Directory);
helpers
.checkDaemonVersion(dataDirectory, data.Version, data.StorageType)
.then(code => {
standardIPCReply(event, Constants.IPC_Check_Daemon_Version_Reply, {
Valid: (code === 0),
});
})
.catch(e=> {
standardIPCReply(event, Constants.IPC_Check_Daemon_Version_Reply, {
Valid: false,
}, e);
});
});
ipcMain.on(Constants.IPC_Check_Daemon_Version + '_sync', (event, data) => {
const dataDirectory = helpers.resolvePath(data.Directory);
helpers
.checkDaemonVersion(dataDirectory, data.Version, data.StorageType)
.then(code => {
event.returnValue = {
data: {
Valid: (code === 0),
},
};
})
.catch(e => {
event.returnValue = {
data: {
Error: e.toString(),
Success: false,
Valid: false
},
};
});
});
ipcMain.on(Constants.IPC_Check_Dependency_Installed, (event, data) => {
try {
const exists = fs.lstatSync(data.File).isFile();