fix(dashboard): mappedIds 限定在当前空间项目,修复跨空间计数偏高
All checks were successful
Push & PR Check / check (push) Successful in 50s
All checks were successful
Push & PR Check / check (push) Successful in 50s
This commit is contained in:
parent
b9f77e75a2
commit
85c79631b9
@ -40,7 +40,8 @@ export function Dashboard() {
|
|||||||
});
|
});
|
||||||
const { data: maps = [] } = useQuery({ queryKey: ["maps"], queryFn: getGroupMaps });
|
const { data: maps = [] } = useQuery({ queryKey: ["maps"], queryFn: getGroupMaps });
|
||||||
|
|
||||||
const mappedIds = new Set(maps.map((m) => m.project_id));
|
const projectIds = new Set(projects.map((p) => p.id));
|
||||||
|
const mappedIds = new Set(maps.map((m) => m.project_id).filter((id) => projectIds.has(id)));
|
||||||
const standalone = projects.filter((p) => !mappedIds.has(p.id));
|
const standalone = projects.filter((p) => !mappedIds.has(p.id));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user