From a5affc09f40b9acf6be0ba5bcd39257b11b1e9d0 Mon Sep 17 00:00:00 2001 From: Mimi Immutable Date: Thu, 27 Jun 2024 17:37:24 +1000 Subject: [PATCH] Remove ref from SaleErorView --- .../src/widgets/sale/views/SaleErrorView.tsx | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/packages/checkout/widgets-lib/src/widgets/sale/views/SaleErrorView.tsx b/packages/checkout/widgets-lib/src/widgets/sale/views/SaleErrorView.tsx index 16dc89aea8..08cf53f0fa 100644 --- a/packages/checkout/widgets-lib/src/widgets/sale/views/SaleErrorView.tsx +++ b/packages/checkout/widgets-lib/src/widgets/sale/views/SaleErrorView.tsx @@ -1,6 +1,4 @@ -import { - useState, useEffect, useContext, useRef, -} from 'react'; +import { useState, useEffect, useContext } from 'react'; import { BaseTokens } from '@biom3/design-tokens'; import { useTranslation } from 'react-i18next'; import { StatusType } from '../../../components/Status/StatusType'; @@ -46,8 +44,6 @@ export function SaleErrorView({ blockExplorerLink, errorType, }: SaleErrorViewProps) { - const mounted = useRef(false); - const { t } = useTranslation(); const { goBackToPaymentMethods, @@ -241,9 +237,7 @@ export function SaleErrorView({ }; useEffect(() => { - if (!environment || !currentErrorType || mounted.current) return; - - mounted.current = true; + if (!environment || !currentErrorType) return; addHandover({ animationUrl: getRemoteRive(