fix: do not get the backend when local path blur
This commit is contained in:
@@ -79,10 +79,11 @@ const AddModal: React.FC<AddModalProps> = (props) => {
|
||||
}
|
||||
};
|
||||
|
||||
const updateShowWarning = () => {
|
||||
const backend = form.current?.getFieldValue?.('backend');
|
||||
const updateShowWarning = (backend: string) => {
|
||||
const localPath = form.current?.getFieldValue?.('local_path');
|
||||
|
||||
console.log('upateShowWarning', backend, localPath);
|
||||
|
||||
if (source !== modelSourceMap.local_path_value || !localPath) {
|
||||
return;
|
||||
}
|
||||
@@ -116,7 +117,7 @@ const AddModal: React.FC<AddModalProps> = (props) => {
|
||||
if (backend === backendOptionsMap.llamaBox) {
|
||||
setIsGGUF(true);
|
||||
}
|
||||
updateShowWarning();
|
||||
updateShowWarning(backend);
|
||||
};
|
||||
|
||||
const handleCancel = useCallback(() => {
|
||||
|
||||
@@ -95,8 +95,7 @@ const UpdateModal: React.FC<AddModalProps> = (props) => {
|
||||
}
|
||||
};
|
||||
|
||||
const updateShowWarning = () => {
|
||||
const backend = form.getFieldValue?.('backend');
|
||||
const updateShowWarning = (backend: string) => {
|
||||
const localPath = form.getFieldValue?.('local_path');
|
||||
|
||||
if (formData?.source !== modelSourceMap.local_path_value || !localPath) {
|
||||
@@ -133,7 +132,7 @@ const UpdateModal: React.FC<AddModalProps> = (props) => {
|
||||
}
|
||||
form.setFieldValue('backend_version', '');
|
||||
handleSetGPUIds(val);
|
||||
updateShowWarning();
|
||||
updateShowWarning(backend);
|
||||
};
|
||||
|
||||
const handleOnFocus = () => {
|
||||
|
||||
Reference in New Issue
Block a user