fix: removed file uploaded successfully message when no file is picked, fixed nvidia ingest message (#7441)

* Removed msg from nvidia_ingest

* Added default file picker timeout

* Use bigger timeout for file picker

* Added condition to only say that file was uploaded successfully if there are files
This commit is contained in:
Lucas Oliveira 2025-04-07 16:15:55 -03:00 committed by GitHub
commit ced8d6d8e5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 17 additions and 10 deletions

View file

@ -24,7 +24,7 @@ class NvidiaIngestComponent(Component):
"NVIDIA Ingest dependencies missing. "
"Please install them using your package manager. (e.g. uv pip install langflow[nv-ingest])"
)
file_types = [msg]
file_types = []
supported_file_types_info = msg
inputs = [

View file

@ -1066,3 +1066,4 @@ export const OPENAI_VOICES = [
export const DEFAULT_POLLING_INTERVAL = 5000;
export const DEFAULT_TIMEOUT = 30000;
export const DEFAULT_FILE_PICKER_TIMEOUT = 60000;

View file

@ -1,3 +1,5 @@
import { DEFAULT_FILE_PICKER_TIMEOUT } from "@/constants/constants";
export function createFileUpload(props?: {
accept?: string;
multiple?: boolean;
@ -64,6 +66,6 @@ export function createFileUpload(props?: {
cleanup();
resolve([]);
}
}, 30000);
}, DEFAULT_FILE_PICKER_TIMEOUT);
});
}

View file

@ -53,10 +53,12 @@ export default function DragFilesComponent({
const filesIds = await uploadFile({
files: droppedFiles,
});
onUpload(filesIds);
setSuccessData({
title: `File${filesIds.length > 1 ? "s" : ""} uploaded successfully`,
});
if (filesIds.length > 0) {
onUpload(filesIds);
setSuccessData({
title: `File${filesIds.length > 1 ? "s" : ""} uploaded successfully`,
});
}
} catch (error: any) {
setErrorData({
title: "Error uploading file",
@ -69,10 +71,12 @@ export default function DragFilesComponent({
const handleClick = async () => {
try {
const filesIds = await uploadFile({});
onUpload(filesIds);
setSuccessData({
title: `File${filesIds.length > 1 ? "s" : ""} uploaded successfully`,
});
if (filesIds.length > 0) {
onUpload(filesIds);
setSuccessData({
title: `File${filesIds.length > 1 ? "s" : ""} uploaded successfully`,
});
}
} catch (error: any) {
setErrorData({
title: "Error uploading file",