mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-11-26 10:46:23 -05:00
fix(tauri_bindings): Emit swap id with WaitingForBtcDeposit event
This commit is contained in:
parent
88cfd6bc3e
commit
de1f77bf80
3 changed files with 32 additions and 13 deletions
|
|
@ -18,13 +18,20 @@ export const swapSlice = createSlice({
|
|||
swap,
|
||||
action: PayloadAction<TauriSwapProgressEventWrapper>,
|
||||
) {
|
||||
// If either:
|
||||
// 1. No swap is currently running
|
||||
// 2. The swap ID of the event does not match the current swap ID
|
||||
//
|
||||
// Then we create a new swap state object that stores the current and previous events
|
||||
if (swap.state === null || action.payload.swap_id !== swap.state.swapId) {
|
||||
console.log("Creating new swap state object");
|
||||
swap.state = {
|
||||
curr: action.payload.event,
|
||||
prev: null,
|
||||
swapId: action.payload.swap_id,
|
||||
};
|
||||
} else {
|
||||
console.log("Updating existing swap state object");
|
||||
swap.state.prev = swap.state.curr;
|
||||
swap.state.curr = action.payload.event;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue