@ctlyst.id/internal-ui 5.4.11 → 5.4.13
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 +6 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -6157,6 +6157,10 @@ var Uploader = ({
|
|
6157
6157
|
const [filePreview, setFilePreview] = (0, import_react94.useState)();
|
6158
6158
|
const [isError, setIsError] = (0, import_react94.useState)(propIsError);
|
6159
6159
|
const [errorText, setErrorText] = (0, import_react94.useState)(propErrorText);
|
6160
|
+
(0, import_react94.useEffect)(() => {
|
6161
|
+
setIsError(propIsError);
|
6162
|
+
setErrorText(propErrorText);
|
6163
|
+
}, [propIsError, propErrorText]);
|
6160
6164
|
const toast2 = useToast();
|
6161
6165
|
const handleRejection = (0, import_react94.useCallback)(
|
6162
6166
|
(message, file, image, errorCode) => {
|
@@ -6184,8 +6188,8 @@ var Uploader = ({
|
|
6184
6188
|
const onDropAccepted = (0, import_react94.useCallback)(
|
6185
6189
|
(files) => {
|
6186
6190
|
const file = files[0];
|
6187
|
-
setIsError(
|
6188
|
-
setErrorText(
|
6191
|
+
setIsError(false);
|
6192
|
+
setErrorText(void 0);
|
6189
6193
|
if (acceptFileType && acceptFileType.includes(file.type)) {
|
6190
6194
|
setFilePreview(file.name);
|
6191
6195
|
onHandleUploadFile == null ? void 0 : onHandleUploadFile(file, null);
|