From 7796696e7143a948a2adc981d1cea1d3edba1fea Mon Sep 17 00:00:00 2001 From: Corey Phillips Date: Tue, 12 Mar 2024 14:20:46 -0400 Subject: [PATCH] fix(wallet): Reset & Setup Tx On-Scan Adds resetSendTransaction & setupOnChainTransaction to processBitcoinTransactionData in scanner.ts. Addresses #1601 --- src/utils/scanner.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/utils/scanner.ts b/src/utils/scanner.ts index df71ba4cd..b9f185939 100644 --- a/src/utils/scanner.ts +++ b/src/utils/scanner.ts @@ -25,7 +25,11 @@ import { } from './wallet/transactions'; import { dispatch, getLightningStore } from '../store/helpers'; import { showToast, ToastOptions } from './notifications'; -import { updateSendTransaction } from '../store/actions/wallet'; +import { + resetSendTransaction, + setupOnChainTransaction, + updateSendTransaction, +} from '../store/actions/wallet'; import { getBalance, getSelectedNetwork, getSelectedWallet } from './wallet'; import { closeSheet } from '../store/slices/ui'; import { showBottomSheet } from '../store/utils/ui'; @@ -602,6 +606,10 @@ export const processBitcoinTransactionData = async ({ selectedWallet?: TWalletName; }): Promise> => { try { + // Reset existing transaction state and prepare for a new one. + await resetSendTransaction(); + await setupOnChainTransaction({}); + let response; let error: ToastOptions | undefined; //Information that will be passed as a notification. let requestedAmount = 0; //Amount requested in sats by the provided invoice.