+ delete wallet data support

+ added fs-extra module
+ use copyFileSync
This commit is contained in:
Taegus
2019-01-29 15:13:58 +01:00
parent 947941a11d
commit 3fa90b2e48
5 changed files with 53 additions and 28 deletions

View File

@@ -83,7 +83,16 @@ ipcMain.on('deleteTransactions', (event, arg) => {
fs.unlink(dbPath, (err) => {
if (err) {
event.returnValue = { success: false, error: err };
dialog.showErrorBox("Error deleting the file", err.message);
} else {
event.returnValue = { success: true, error: null };
}
});
});
ipcMain.on('deleteWalletData', (event, arg) => {
fs.unlink(path.join(app.getPath('userData'), 'wallets.json'), (err) => {
if (err) {
event.returnValue = { success: false, error: err };
} else {
event.returnValue = { success: true, error: null };
}