componentes-sinco 1.0.18 → 1.0.20

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.cjs CHANGED
@@ -463,24 +463,16 @@ var Attachment = ({
463
463
  const inputRef = (0, import_react5.useRef)(null);
464
464
  (0, import_react5.useEffect)(() => {
465
465
  if (initialFiles.length > 0) {
466
- setFiles(initialFiles);
467
- }
468
- }, [initialFiles]);
469
- (0, import_react5.useEffect)(() => {
470
- const interval = setInterval(() => {
471
- setFiles((prevFiles) => {
472
- let updated = false;
473
- const nuevosArchivos = prevFiles.map((file) => {
474
- if (!file.uploadError && file.progress < 100) {
475
- updated = true;
476
- return __spreadProps(__spreadValues({}, file), { progress: Math.min(file.progress + 15, 100) });
477
- }
478
- return file;
466
+ const initials = initialFiles.map((f) => {
467
+ var _a, _b;
468
+ return __spreadProps(__spreadValues({}, f), {
469
+ progress: (_a = f.progress) != null ? _a : 100,
470
+ uploadError: (_b = f.uploadError) != null ? _b : false
479
471
  });
480
- return updated ? nuevosArchivos : prevFiles;
481
472
  });
482
- }, 1e3);
483
- return () => clearInterval(interval);
473
+ setFiles(initials);
474
+ onChange == null ? void 0 : onChange(initials.map((f) => new File([], f.name, { type: f.type })));
475
+ }
484
476
  }, []);
485
477
  const handleDrop = (event2) => {
486
478
  event2.preventDefault();