Skip to content

Commit

Permalink
fix: ts
Browse files Browse the repository at this point in the history
  • Loading branch information
c121914yu committed Sep 20, 2023
1 parent 63b183a commit 0c8e1ec
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ const KBSelect = ({
onChange: (e: SelectedKbType) => void;
}) => {
const theme = useTheme();
const { datasets, loadAllDatasets } = useDatasetStore();
const { allDatasets, loadAllDatasets } = useDatasetStore();
const {
isOpen: isOpenKbSelect,
onOpen: onOpenKbSelect,
onClose: onCloseKbSelect
} = useDisclosure();

const showKbList = useMemo(
() => datasets.filter((item) => activeKbs.find((kb) => kb.kbId === item._id)),
[datasets, activeKbs]
() => allDatasets.filter((item) => activeKbs.find((kb) => kb.kbId === item._id)),
[allDatasets, activeKbs]
);

useQuery(['loadAllDatasets'], loadAllDatasets);
Expand All @@ -57,9 +57,12 @@ const KBSelect = ({
</Flex>
))}
</Grid>
{isOpenKbSelect && (
<KBSelectModal activeKbs={activeKbs} onChange={onChange} onClose={onCloseKbSelect} />
)}
<KBSelectModal
isOpen={isOpenKbSelect}
activeKbs={activeKbs}
onChange={onChange}
onClose={onCloseKbSelect}
/>
</>
);
};
Expand Down

0 comments on commit 0c8e1ec

Please sign in to comment.