Fix backward compatibility issue with suffixes in
InputFileComponent
This commit is contained in:
parent
20a99ed418
commit
9735fa2abe
1 changed files with 12 additions and 0 deletions
|
|
@ -19,6 +19,18 @@ export default function InputFileComponent({
|
||||||
const { setErrorData } = useContext(alertContext);
|
const { setErrorData } = useContext(alertContext);
|
||||||
const { tabId } = useContext(FlowsContext);
|
const { tabId } = useContext(FlowsContext);
|
||||||
|
|
||||||
|
// For backward compatibility, if the suffixes are not provided, allow use fileTypes instead
|
||||||
|
if (!suffixes) {
|
||||||
|
// if fileTypes does not have '.' at the beginning, add it
|
||||||
|
// and use it as suffixes
|
||||||
|
suffixes = fileTypes.map((fileType) => {
|
||||||
|
if (!fileType.startsWith(".")) {
|
||||||
|
return "." + fileType;
|
||||||
|
}
|
||||||
|
return fileType;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Clear component state
|
// Clear component state
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (disabled) {
|
if (disabled) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue