From a2f894d82262361f6925d874bd6e274aa60e78ae Mon Sep 17 00:00:00 2001 From: newCodeRunner <57590297+newCodeRunner@users.noreply.github.com> Date: Tue, 8 Dec 2020 18:47:41 +0500 Subject: [PATCH] Update wallets.js Event listener for click button --- renderer/wallets.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/renderer/wallets.js b/renderer/wallets.js index 0199f33..ba71b84 100755 --- a/renderer/wallets.js +++ b/renderer/wallets.js @@ -178,6 +178,20 @@ $(document).on("render_wallets", function () { $("#dlgShowAddressQRCode").iziModal("close"); }); }); + + $(".btnDeleteAddress").off("click").on("click", function () { + const address = $(this).attr("data-wallet"); + EthoMainGUI.showGeneralConfirmation( + `Do you really want to delete Wallet with Address: ${address}? This action can not be reversed.`, + function (result) { + if (result) { + const deleteResult = ipcRenderer.sendSync('deteteAccount', address); + if (deleteResult !== true) EthoMainGUI.showGeneralError(deleteResult); + setTimeout(EthoWallets.renderWalletsState, 1000); + } + }, + ); + }); $(".btnChangWalletName").off("click").on("click", function () { var walletAddress = $(this).attr("data-wallet"); @@ -279,4 +293,4 @@ $(document).on("onNewAccountTransaction", function () { } }); -EthoWallets = new Wallets(); \ No newline at end of file +EthoWallets = new Wallets();