fix: yuque dataset file folder can enter (#3593)

This commit is contained in:
heheer
2025-01-14 20:40:00 +08:00
committed by archer
parent 0d9f54cbf3
commit 68f5afeba0
3 changed files with 10 additions and 3 deletions

View File

@@ -49,7 +49,6 @@ const CustomAPIFileInput = () => {
parentId: '',
parentName: ''
});
const [parentUuid, setParentUuid] = useState<string>('');
const [paths, setPaths] = useState<ParentTreePathItemType[]>([]);
const [searchKey, setSearchKey] = useState('');
@@ -128,7 +127,7 @@ const CustomAPIFileInput = () => {
const handleItemClick = useCallback(
(item: APIFileItem) => {
if (item.type === 'folder') {
if (item.canEnter) {
setPaths((state) => [...state, { parentId: item.id, parentName: item.name }]);
return setParent({
parentId: item.id,
@@ -251,6 +250,7 @@ const CustomAPIFileInput = () => {
<Box fontSize={'sm'} fontWeight={'medium'} color={'myGray.900'}>
{item.name}
</Box>
{item.canEnter && <MyIcon name="core/chat/chevronRight" w={'18px'} ml={2} />}
</Flex>
);
})}