Skip to content

Commit

Permalink
Update chart on outgoing tx
Browse files Browse the repository at this point in the history
  • Loading branch information
n9lsjr committed Dec 2, 2023
1 parent 4ffd0f9 commit d699a7d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/backend/electron.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ ipcMain.on("start-wallet", async (e, walletName, password, node) => {
console.log("Regained connection to daemon!");
mainWindow.webContents.send("node-status", "Connected");
});

walletBackend.on("incomingtx", (transaction) => {
console.log(transaction);
mainWindow.webContents.send("incoming-tx", transaction, transaction.totalAmount());
Expand Down Expand Up @@ -630,7 +630,7 @@ ipcMain.handle('prepare-transaction', async (e, address, amount, paymentID, send
ipcMain.handle('send-transaction', async (e, hash) => {
const result = await walletBackend.sendPreparedTransaction(hash)
if (!result.success) errorMessage('Error: Could not send transaction')
successMessage('Transaction sent!')
mainWindow.webContents.send("outgoing-tx")
return result.success;
})

Expand Down
4 changes: 4 additions & 0 deletions src/routes/wallet/dashboard/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
await formatAndRender(true);
});
window.api.receive('outgoing-tx', async () => {
await formatAndRender(true);
});
async function formatAndRender(update) {
await formatTransactions();
await renderchart(update);
Expand Down

0 comments on commit d699a7d

Please sign in to comment.