fix: categories value error

This commit is contained in:
jialin
2025-04-02 17:55:10 +08:00
parent 89a6d6a4c1
commit d3e58c85cf
9 changed files with 46 additions and 44 deletions
+2 -2
View File
@@ -22,7 +22,7 @@ const LocalPathForm: React.FC = () => {
const { modelFileOptions, byBuiltIn } = formCtx;
const { getRuleMessage } = useAppUtils();
const intl = useIntl();
const localPathCache = useRef<string>(form.getFieldValue('local_path'));
const localPathCache = useRef<string>(form.getFieldValue('local_path') || '');
if (![modelSourceMap.local_path_value].includes(source) || byBuiltIn) {
return null;
@@ -30,7 +30,7 @@ const LocalPathForm: React.FC = () => {
const handleLocalPathBlur = (e: any) => {
const value = e.target.value;
if (value === localPathCache.current && value) {
if (value === localPathCache.current || !value) {
return;
}
const isEndwithGGUF = _.endsWith(value, '.gguf');