Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(wallet): Reset & Setup Tx On-Scan #1603

Merged
merged 1 commit into from
Mar 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/utils/scanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -602,6 +606,10 @@ export const processBitcoinTransactionData = async ({
selectedWallet?: TWalletName;
}): Promise<Result<QRData>> => {
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.
Expand Down
Loading