diff --git a/apps/OpenSign/src/primitives/DotLottieReact.js b/apps/OpenSign/src/primitives/DotLottieReact.js index b3b001d00..66ca3b8b3 100644 --- a/apps/OpenSign/src/primitives/DotLottieReact.js +++ b/apps/OpenSign/src/primitives/DotLottieReact.js @@ -2,20 +2,13 @@ import React, { useState, useEffect } from "react"; import { DotLottieReact } from "@lottiefiles/dotlottie-react"; import Loader from "./Loader"; -const LottieWithLoader = ({ - src = "https://lottie.host/00a72a09-f2d4-493a-9b2d-2843bf067638/Ic7jJ44wLJ.json", - minLoaderTime = 1000, - timeout = 10000 -}) => { +const LottieWithLoader = () => { const [isLoaded, setIsLoaded] = useState(false); const [hasError, setHasError] = useState(false); const [animationSrc, setAnimationSrc] = useState(null); - + const src = + "https://lottie.host/00a72a09-f2d4-493a-9b2d-2843bf067638/Ic7jJ44wLJ.json"; useEffect(() => { - const timer = setTimeout(() => { - setHasError(true); - }, timeout); - fetch(src) .then((response) => { if (!response.ok) { @@ -26,17 +19,13 @@ const LottieWithLoader = ({ .then((blob) => { const objectURL = URL.createObjectURL(blob); setAnimationSrc(objectURL); - setTimeout(() => { - setIsLoaded(true); - }, minLoaderTime); + setIsLoaded(true); }) .catch((error) => { - console.error("There was a problem with the fetch operation:", error); + console.error("faild to load animation of send request:", error); setHasError(true); }); - - return () => clearTimeout(timer); - }, [src, minLoaderTime, timeout]); + }, [src]); return (