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.cjs +15 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +15 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -483,10 +483,21 @@ var Attachment = ({
|
|
|
483
483
|
const [isDragFile, setIsDragFile] = (0, import_react5.useState)(false);
|
|
484
484
|
const inputRef = (0, import_react5.useRef)(null);
|
|
485
485
|
(0, import_react5.useEffect)(() => {
|
|
486
|
-
|
|
487
|
-
setFiles(
|
|
488
|
-
|
|
489
|
-
|
|
486
|
+
const interval = setInterval(() => {
|
|
487
|
+
setFiles((prevFiles) => {
|
|
488
|
+
let updated = false;
|
|
489
|
+
const nuevosArchivos = prevFiles.map((file) => {
|
|
490
|
+
if (!file.uploadError && file.progress < 100) {
|
|
491
|
+
updated = true;
|
|
492
|
+
return __spreadProps(__spreadValues({}, file), { progress: Math.min(file.progress + 15, 100) });
|
|
493
|
+
}
|
|
494
|
+
return file;
|
|
495
|
+
});
|
|
496
|
+
return updated ? nuevosArchivos : prevFiles;
|
|
497
|
+
});
|
|
498
|
+
}, 1e3);
|
|
499
|
+
return () => clearInterval(interval);
|
|
500
|
+
}, [files]);
|
|
490
501
|
const handleDrop = (event2) => {
|
|
491
502
|
event2.preventDefault();
|
|
492
503
|
setIsDragFile(false);
|