Skip to content

Commit cc398d6

Browse files
authored
Merge pull request #883 from OpenSignLabs/raktima-opensignlabs-patch-10
fix: unnecessary showing message faild to load on send document popup
2 parents 6d4ebf7 + cd48448 commit cc398d6

File tree

1 file changed

+6
-17
lines changed

1 file changed

+6
-17
lines changed

apps/OpenSign/src/primitives/DotLottieReact.js

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,13 @@ import React, { useState, useEffect } from "react";
22
import { DotLottieReact } from "@lottiefiles/dotlottie-react";
33
import Loader from "./Loader";
44

5-
const LottieWithLoader = ({
6-
src = "https://lottie.host/00a72a09-f2d4-493a-9b2d-2843bf067638/Ic7jJ44wLJ.json",
7-
minLoaderTime = 1000,
8-
timeout = 10000
9-
}) => {
5+
const LottieWithLoader = () => {
106
const [isLoaded, setIsLoaded] = useState(false);
117
const [hasError, setHasError] = useState(false);
128
const [animationSrc, setAnimationSrc] = useState(null);
13-
9+
const src =
10+
"https://lottie.host/00a72a09-f2d4-493a-9b2d-2843bf067638/Ic7jJ44wLJ.json";
1411
useEffect(() => {
15-
const timer = setTimeout(() => {
16-
setHasError(true);
17-
}, timeout);
18-
1912
fetch(src)
2013
.then((response) => {
2114
if (!response.ok) {
@@ -26,17 +19,13 @@ const LottieWithLoader = ({
2619
.then((blob) => {
2720
const objectURL = URL.createObjectURL(blob);
2821
setAnimationSrc(objectURL);
29-
setTimeout(() => {
30-
setIsLoaded(true);
31-
}, minLoaderTime);
22+
setIsLoaded(true);
3223
})
3324
.catch((error) => {
34-
console.error("There was a problem with the fetch operation:", error);
25+
console.error("faild to load animation of send request:", error);
3526
setHasError(true);
3627
});
37-
38-
return () => clearTimeout(timer);
39-
}, [src, minLoaderTime, timeout]);
28+
}, [src]);
4029

4130
return (
4231
<div>

0 commit comments

Comments
 (0)