From 0fa2d5c9ba464f88626533ab54802bd00951b052 Mon Sep 17 00:00:00 2001 From: samuelea Date: Tue, 30 Apr 2024 10:39:53 -0400 Subject: [PATCH] fix succes page --- packages/checkout/src/contexts/Navigation.tsx | 1 - packages/checkout/src/views/PendingTransaction.tsx | 2 -- packages/checkout/src/views/TransactionSuccess.tsx | 3 ++- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/checkout/src/contexts/Navigation.tsx b/packages/checkout/src/contexts/Navigation.tsx index 31c43d5c..6b174e61 100644 --- a/packages/checkout/src/contexts/Navigation.tsx +++ b/packages/checkout/src/contexts/Navigation.tsx @@ -11,7 +11,6 @@ export interface TransactionFormNavigation { export interface TransactionSuccessParams { transactionHash: string - network: string } export interface TransactionSuccessNavigation { diff --git a/packages/checkout/src/views/PendingTransaction.tsx b/packages/checkout/src/views/PendingTransaction.tsx index 7edcd024..55a48435 100644 --- a/packages/checkout/src/views/PendingTransaction.tsx +++ b/packages/checkout/src/views/PendingTransaction.tsx @@ -30,7 +30,6 @@ export const PendingTransaction = () => { const pollResponse = await fetchSardineOrderStatus(orderId, isDev) const status = pollResponse.resp.status const transactionHash = pollResponse.resp?.data?.transactionHash - const network = pollResponse.resp?.data?.network console.log('transaction status poll response:', status) @@ -43,7 +42,6 @@ export const PendingTransaction = () => { location: 'transaction-success', params: { transactionHash, - network } }) return diff --git a/packages/checkout/src/views/TransactionSuccess.tsx b/packages/checkout/src/views/TransactionSuccess.tsx index 3015396f..152e2d88 100644 --- a/packages/checkout/src/views/TransactionSuccess.tsx +++ b/packages/checkout/src/views/TransactionSuccess.tsx @@ -10,7 +10,8 @@ export const TransactionSuccess = () => { const nav = useNavigation() const navigation = nav.navigation as TransactionSuccessNavigation - const network = sequence.network.allNetworks.find(n => n.name === navigation.params.network) + const chainId = settings?.sardineCheckout?.chainId || 137 + const network = sequence.network.allNetworks.find(n => n.chainId === chainId) useEffect(() => { settings?.sardineCheckout?.onSuccess && settings?.sardineCheckout?.onSuccess(navigation.params.transactionHash, settings?.sardineCheckout) settings?.sardineCheckout?.onSuccess && settings?.sardineCheckout?.onSuccess(navigation.params.transactionHash, settings?.sardineCheckout)