From 2195185115024fc27f44ba3a60894f197f48ac84 Mon Sep 17 00:00:00 2001 From: Alessandro Date: Mon, 16 Dec 2024 10:01:51 +0100 Subject: [PATCH] chore: [IOBP-1085] Removed delete transaction API request when closing in-app browser (#6553) ## Short description This PR removes the delete transaction API request when the user closes the in-app browser during the payment flow. ## List of changes proposed in this pull request - Removed the API request trigger when closing the payment flow form the in-app browser. ## How to test - Start a payment flow with the dev-server started; - Reach the final step when the in-app browser appears; - Tap on "Cancel" button and check that the API request to delete the transaction isn't fired; --- .../hooks/useWalletPaymentAuthorizationModal.tsx | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/ts/features/payments/checkout/hooks/useWalletPaymentAuthorizationModal.tsx b/ts/features/payments/checkout/hooks/useWalletPaymentAuthorizationModal.tsx index fd534b7f001..5aab883cdda 100644 --- a/ts/features/payments/checkout/hooks/useWalletPaymentAuthorizationModal.tsx +++ b/ts/features/payments/checkout/hooks/useWalletPaymentAuthorizationModal.tsx @@ -10,13 +10,9 @@ import { WALLET_WEBVIEW_OUTCOME_SCHEMA } from "../../common/utils/const"; import { storePaymentOutcomeToHistory } from "../../history/store/actions"; import { WalletPaymentAuthorizePayload, - paymentsDeleteTransactionAction, paymentsStartPaymentAuthorizationAction } from "../store/actions/networking"; -import { - walletPaymentAuthorizationUrlSelector, - walletPaymentTransactionSelector -} from "../store/selectors/transaction"; +import { walletPaymentAuthorizationUrlSelector } from "../store/selectors/transaction"; import { WalletPaymentOutcome, WalletPaymentOutcomeEnum @@ -41,8 +37,6 @@ export const useWalletPaymentAuthorizationModal = ({ const authorizationUrlPot = useIOSelector( walletPaymentAuthorizationUrlSelector ); - const transactionPot = useIOSelector(walletPaymentTransactionSelector); - const [isPendingAuthorization, setIsPendingAuthorization] = React.useState(false); const isLoading = pot.isLoading(authorizationUrlPot); @@ -91,13 +85,6 @@ export const useWalletPaymentAuthorizationModal = ({ handleAuthorizationOutcome( WalletPaymentOutcomeEnum.IN_APP_BROWSER_CLOSED_BY_USER ); - if (pot.isSome(transactionPot)) { - dispatch( - paymentsDeleteTransactionAction.request( - transactionPot.value.transactionId - ) - ); - } } ) ), @@ -108,7 +95,6 @@ export const useWalletPaymentAuthorizationModal = ({ isLoading, isPendingAuthorization, authorizationUrlPot, - transactionPot, handleAuthorizationResult, handleAuthorizationOutcome, dispatch