Skip to content

Commit 43d5580

Browse files
committed
[TOOL-3260] SDK: Fix Pay Modal logging react-query error when opened
1 parent 411895c commit 43d5580

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

.changeset/gentle-dancers-raise.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"thirdweb": patch
3+
---
4+
5+
Fix thirdweb Pay Modal logging react-query error when opened

packages/thirdweb/src/react/web/ui/TransactionButton/TransactionModal.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,19 @@ export function TransactionModal(props: ModalProps) {
3737
useQuery({
3838
queryKey: ["transaction-modal-event"],
3939
queryFn: () => {
40-
if (!account || !wallet) return;
40+
// Query data cannot be undefined, return null
41+
if (!account || !wallet) {
42+
return null;
43+
}
4144
trackPayEvent({
4245
client: props.client,
4346
walletAddress: account.address,
4447
walletType: wallet.id,
4548
dstChainId: props.tx.chain.id,
4649
event: "open_pay_transaction_modal",
4750
});
51+
52+
return null;
4853
},
4954
enabled: !!wallet,
5055
});

0 commit comments

Comments
 (0)