+ delete and re-sync transactions

+ add to address book from send screen
This commit is contained in:
Taegus
2018-12-28 10:26:32 +01:00
parent d33f90b738
commit 1c629801c4
7 changed files with 94 additions and 40 deletions

View File

@@ -1,8 +1,9 @@
const {app, ipcMain} = require('electron');
const {app, dialog, ipcMain} = require('electron');
const storage = require('electron-storage');
const datastore = require('nedb');
const moment = require('moment');
const path = require('path');
const fs = require('fs');
const dbPath = path.join(app.getPath('userData'), 'storage.db');
const db = new datastore({ filename: dbPath });
@@ -76,4 +77,15 @@ ipcMain.on('setJSONFile', (event, arg) => {
event.returnValue = { success: true, error: null };
}
});
});
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 };
}
});
});