diff --git a/src/components/modals/ErrorModal.tsx b/src/components/modals/ErrorModal.tsx
index b5b59cc..5623afd 100644
--- a/src/components/modals/ErrorModal.tsx
+++ b/src/components/modals/ErrorModal.tsx
@@ -1,3 +1,4 @@
+import { useModalsManagerContext } from "@/contexts/ModalsManagerContext";
import Button from "@components/Button";
import Box from "@components/bases/Box";
import ErrorIcon from "@components/icons/ErrorIcon";
@@ -5,10 +6,11 @@ import { Text } from "react-native";
interface Props {
message?: string;
- onPress?: () => void;
+ // onPress?: () => void;
}
-const ErrorModal = ({ message = "Une erreur s'est produite", onPress = () => {} }: Props) => {
+const ErrorModal = ({ message = "Une erreur s'est produite" }: Props) => {
+ const { closeModal } = useModalsManagerContext();
return (
{}
variant={"fullError"}
textVariants={"white"}
label="Fermer"
- onPress={onPress}
+ onPress={closeModal}
/>
diff --git a/src/hooks/useOrangeMoney.tsx b/src/hooks/useOrangeMoney.tsx
index 4a8a2d0..3612365 100644
--- a/src/hooks/useOrangeMoney.tsx
+++ b/src/hooks/useOrangeMoney.tsx
@@ -85,16 +85,9 @@ const useOrangeMoney = () => {
if (error instanceof Error) {
if (error.name === "ORANGE_PAYMENT_IN_PROGRESS") {
log.warn("handlePaymentButton | ORANGE_PAYMENT_IN_PROGRESS");
- showModal(
-
- await openBrowserThenCheckStatus(paymentUrl, orderId)
- }
- />,
- );
+ showModal();
} else if (error.name === "ORANGE_PAYMENT_FAILED") {
- showModal();
+ showModal();
log.error("handlePaymentButton | ORANGE_PAYMENT_FAILED");
}
} else {