Skip to content

Commit f5c6250

Browse files
committed
[MNY-200] SDK: Fix onSuccess callback not called when tx is sent in TransactionWidget
1 parent 0673b89 commit f5c6250

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

packages/thirdweb/src/react/web/ui/Bridge/BridgeOrchestrator.tsx

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -189,13 +189,9 @@ export function BridgeOrchestrator({
189189
}, [send, uiOptions.mode]);
190190

191191
// Handle post-buy transaction completion
192-
const handlePostBuyTransactionComplete = useCallback(
193-
(quote: BridgePrepareResult) => {
194-
onComplete?.(quote);
195-
send({ type: "RESET" });
196-
},
197-
[onComplete, send],
198-
);
192+
const handlePostBuyTransactionComplete = useCallback(() => {
193+
send({ type: "RESET" });
194+
}, [send]);
199195

200196
// Handle errors
201197
const handleError = useCallback(
@@ -416,9 +412,9 @@ export function BridgeOrchestrator({
416412
quote &&
417413
uiOptions.transaction && (
418414
<ExecutingTxScreen
419-
closeModal={() => handlePostBuyTransactionComplete(quote)}
415+
closeModal={handlePostBuyTransactionComplete}
420416
onTxSent={() => {
421-
// Do nothing
417+
onComplete?.(quote);
422418
}}
423419
tx={uiOptions.transaction}
424420
windowAdapter={webWindowAdapter}

0 commit comments

Comments
 (0)