daisy
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
5 deletions
-
components/upload/UploadList/ListItem.tsx
|
|
@ -82,15 +82,12 @@ const ListItem = React.forwardRef( |
|
|
|
|
|
|
|
// Delay to show the progress bar
|
|
|
|
const [showProgress, setShowProgress] = React.useState(false); |
|
|
|
const progressRafRef = React.useRef<NodeJS.Timer | null>(null); |
|
|
|
React.useEffect(() => { |
|
|
|
progressRafRef.current = setTimeout(() => { |
|
|
|
const timer = setTimeout(() => { |
|
|
|
setShowProgress(true); |
|
|
|
}, 300); |
|
|
|
return () => { |
|
|
|
if (progressRafRef.current) { |
|
|
|
clearTimeout(progressRafRef.current); |
|
|
|
} |
|
|
|
clearTimeout(timer); |
|
|
|
}; |
|
|
|
}, []); |
|
|
|
|
|
|
|