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:
parent
73302a0a1d
commit
ced8d6d8e5
4 changed files with 17 additions and 10 deletions
|
|
@ -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 = [
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue