componentes-sinco 1.0.22 → 1.0.24

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,21 +415,22 @@ var Attachment = ({
415
415
  const [isDragFile, setIsDragFile] = useState4(false);
416
416
  const inputRef = useRef(null);
417
417
  useEffect4(() => {
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
- }
418
+ if (initialFiles && initialFiles.length > 0) {
419
+ const mapped = initialFiles.map((file) => {
420
+ if ("progress" in file) {
426
421
  return file;
427
- });
428
- return updated ? nuevosArchivos : prevFiles;
422
+ }
423
+ return {
424
+ name: file.name,
425
+ size: file.size,
426
+ type: file.type,
427
+ progress: 100,
428
+ uploadError: false
429
+ };
429
430
  });
430
- }, 1e3);
431
- return () => clearInterval(interval);
432
- }, [files]);
431
+ setFiles(mapped);
432
+ }
433
+ }, [initialFiles]);
433
434
  const handleDrop = (event2) => {
434
435
  event2.preventDefault();
435
436
  setIsDragFile(false);