+ 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

@@ -24,23 +24,28 @@ $(document).on("render_settings", function() {
var counters = EthoDatatabse.getCounters();
counters.transactions = 0;
EthoDatatabse.setCounters(counters);
ipcRenderer.sendSync('deleteTransactions', null);
// sync all the transactions to the current block
web3Local.eth.getBlock("latest", function(error, localBlock) {
if (error) {
EthoMainGUI.showGeneralError(error);
} else {
EthoTransactions.enableKeepInSync();
EthoTransactions.syncTransactionsForAllAddresses(localBlock.number);
iziToast.success({
title: 'Success',
message: 'Transactions are being resynced',
position: 'topRight',
timeout: 5000
});
}
});
ipcResult = ipcRenderer.sendSync('deleteTransactions', null);
if (ipcResult.success) {
// sync all the transactions to the current block
web3Local.eth.getBlock("latest", function(error, localBlock) {
if (error) {
EthoMainGUI.showGeneralError(error);
} else {
EthoTransactions.enableKeepInSync();
EthoTransactions.syncTransactionsForAllAddresses(localBlock.number);
iziToast.success({
title: 'Success',
message: 'Transactions are being resynced',
position: 'topRight',
timeout: 5000
});
}
});
} else {
EthoMainGUI.showGeneralError("Error resyncing transactions: " + ipcResult.error);
}
}
}
});
@@ -55,7 +60,18 @@ $(document).on("render_settings", function() {
});
$("#btnSettingsCleanWallets").off('click').on('click', function() {
EthoMainGUI.showGeneralError("Not implemented yet!");
ipcResult = ipcRenderer.sendSync('deleteWalletData', null);
if (ipcResult.success) {
iziToast.success({
title: 'Success',
message: 'Wallet names were succesfully cleaned',
position: 'topRight',
timeout: 5000
});
} else {
EthoMainGUI.showGeneralError("Error clearing wallet names: " + ipcResult.error);
}
});
$("#btnSettingsCleanBlockchain").off('click').on('click', function() {