Skip to content
Snippets Groups Projects
Commit e41fc432 authored by azubieta's avatar azubieta
Browse files

Fix data dir to HOME/.config/OCS-Store

parents 2c19a3b6 3bf08b09
No related branches found
No related tags found
2 merge requests!9Development,!7Fix data dir to HOME/.config/OCS-Store
Pipeline #864 passed
......@@ -107,8 +107,7 @@ function isFile(path) {
try {
const stats = fs.statSync(path);
return stats.isFile();
}
catch (error) {
} catch (error) {
console.error(error);
return false;
}
......@@ -118,8 +117,7 @@ function isDirectory(path) {
try {
const stats = fs.statSync(path);
return stats.isDirectory();
}
catch (error) {
} catch (error) {
console.error(error);
return false;
}
......@@ -159,8 +157,7 @@ function removePreviewpic(itemKey) {
app.on('ready', async () => {
if (await startOcsManager()) {
createWindow();
}
else {
} else {
app.quit();
}
});
......@@ -192,6 +189,9 @@ app.on('web-contents-created', (event, webContents) => {
}
});
// Set configs dir
app.setPath("userData", app.getPath("appData") + "/OCS-Store")
ipcMain.on('app', (event, key) => {
const data = {
package: appPackage,
......@@ -220,19 +220,15 @@ ipcMain.on('store', (event, key, value) => {
ipcMain.on('previewpic', (event, kind, itemKey, url) => {
if (kind === 'directory') {
event.returnValue = previewpicDirectory;
}
else if (kind === 'path' && itemKey) {
} else if (kind === 'path' && itemKey) {
event.returnValue = `${previewpicDirectory}/${previewpicFilename(itemKey)}`;
}
else if (kind === 'download' && itemKey && url) {
} else if (kind === 'download' && itemKey && url) {
downloadPreviewpic(itemKey, url);
event.returnValue = undefined;
}
else if (kind === 'remove' && itemKey) {
} else if (kind === 'remove' && itemKey) {
removePreviewpic(itemKey);
event.returnValue = undefined;
}
else {
} else {
event.returnValue = false;
}
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment