componentes-sinco 1.0.21 → 1.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -415,10 +415,21 @@ var Attachment = ({
415
415
  const [isDragFile, setIsDragFile] = useState4(false);
416
416
  const inputRef = useRef(null);
417
417
  useEffect4(() => {
418
- if (initialFiles.length > 0) {
419
- setFiles(initialFiles);
420
- }
421
- }, [initialFiles]);
418
+ const interval = setInterval(() => {
419
+ setFiles((prevFiles) => {
420
+ let updated = false;
421
+ const nuevosArchivos = prevFiles.map((file) => {
422
+ if (!file.uploadError && file.progress < 100) {
423
+ updated = true;
424
+ return __spreadProps(__spreadValues({}, file), { progress: Math.min(file.progress + 15, 100) });
425
+ }
426
+ return file;
427
+ });
428
+ return updated ? nuevosArchivos : prevFiles;
429
+ });
430
+ }, 1e3);
431
+ return () => clearInterval(interval);
432
+ }, [files]);
422
433
  const handleDrop = (event2) => {
423
434
  event2.preventDefault();
424
435
  setIsDragFile(false);