fix: image editor fit view incorrect, do not query gguf files when gguf unchecked

This commit is contained in:
jialin
2025-06-09 18:45:47 +08:00
parent e69b7dfd6a
commit 4dcb0bcfed
15 changed files with 158 additions and 91 deletions
@@ -313,7 +313,7 @@ const HFModelFile: React.FC<HFModelFileProps> = forwardRef((props, ref) => {
return sortType === 'size' ? item.size : item.path;
});
handleSelectModelFile(sortList[0]);
handleSelectModelFile(sortList[0] || {});
setDataSource({ fileList: sortList, loading: false });
} catch (error) {
setDataSource({ fileList: [], loading: false });
@@ -329,12 +329,6 @@ const HFModelFile: React.FC<HFModelFileProps> = forwardRef((props, ref) => {
setDataSource({ ...dataSource, fileList: list });
};
const handleOnEnter = (e: any, item: any) => {
e.stopPropagation();
if (e.key === 'Enter') {
handleSelectModelFile(item);
}
};
useImperativeHandle(ref, () => ({
fetchModelFiles: handleFetchModelFiles
}));
@@ -398,7 +392,6 @@ const HFModelFile: React.FC<HFModelFileProps> = forwardRef((props, ref) => {
isEvaluating={isEvaluating}
active={item.path === current}
handleSelectModelFile={handleSelectModelFile}
handleOnEnter={handleOnEnter}
></ModelFileItem>
);
})}