Fix type error

This commit is contained in:
Ramon Wenger 2024-07-11 09:48:59 +02:00 committed by Christian Cueni
parent a43d2df082
commit 3258aaa5d3
1 changed files with 5 additions and 3 deletions

View File

@ -41,10 +41,12 @@ const scrollLearnPathDiagram = (offset: number) => {
const filterCircles = (topic: TopicType) => {
// return [];
if (props.filter) {
return topic.circles.filter((circle) => circle.profiles.indexOf(props.filter) > -1);
}
if (props.filter === undefined) {
return topic.circles;
}
return topic.circles.filter(
(circle) => circle.profiles.indexOf(props.filter as string) > -1
);
};
</script>