mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-08-07 22:12:51 -04:00
feat(tauri): send tauri event on btc balance change (#113)
Closes #43. This PR creates a new event, which is emitted by the watcher daemon when the BTC balance changes. Then, on the guest side, we simply update the balance when this event is received.
This commit is contained in:
parent
ec86fa13cd
commit
639f540876
7 changed files with 532 additions and 115 deletions
|
@ -67,6 +67,11 @@ export async function initEventListeners() {
|
|||
store.dispatch(receivedCliLog(event.payload));
|
||||
});
|
||||
|
||||
listen<BalanceResponse>("balance-change", (event) => {
|
||||
console.log("Received balance change event", event.payload);
|
||||
store.dispatch(rpcSetBalance(event.payload.balance));
|
||||
});
|
||||
|
||||
listen<TauriDatabaseStateEvent>("swap-database-state-update", (event) => {
|
||||
console.log("Received swap database state update event", event.payload);
|
||||
getSwapInfo(event.payload.swap_id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue