mirror of
https://github.com/arkorty/DownLink.git
synced 2026-03-17 16:51:45 +00:00
Fix: do not render the processing bar when progress is more than 0%
This commit is contained in:
Binary file not shown.
@@ -58,18 +58,13 @@ const DownloadForm = () => {
|
|||||||
return "bg-blue-500"; // Default color when not processing
|
return "bg-blue-500"; // Default color when not processing
|
||||||
};
|
};
|
||||||
|
|
||||||
const getBarStyle = () => {
|
const getBarStyle = () => ({
|
||||||
if (message === "Download complete" || message === "Download failed") {
|
transition: "width 0.5s ease-in-out",
|
||||||
return { transition: "width 0.5s ease-in-out" };
|
});
|
||||||
}
|
|
||||||
return { transition: "width 0.5s ease-in-out" };
|
|
||||||
};
|
|
||||||
|
|
||||||
const getAnimationStyle = () => {
|
const getAnimationStyle = () => {
|
||||||
if (message === "Download complete" || message === "Download failed") {
|
// Hide the loading animation when progress is greater than 0
|
||||||
return { animation: "none" };
|
return progress === 0 ? { animation: "loading 1.5s infinite" } : {};
|
||||||
}
|
|
||||||
return { animation: "loading 1.5s infinite" };
|
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -136,7 +131,7 @@ const DownloadForm = () => {
|
|||||||
...getBarStyle(),
|
...getBarStyle(),
|
||||||
}}
|
}}
|
||||||
></div>
|
></div>
|
||||||
{isProcessing && (
|
{isProcessing && progress === 0 && (
|
||||||
<div
|
<div
|
||||||
className={`absolute top-0 left-0 w-full h-full bg-blue-300 rounded-full`}
|
className={`absolute top-0 left-0 w-full h-full bg-blue-300 rounded-full`}
|
||||||
style={getAnimationStyle()}
|
style={getAnimationStyle()}
|
||||||
|
|||||||
Reference in New Issue
Block a user