Skip to content

armgit / plane

Public Imported from GitHub
0

πŸ”₯πŸ”₯πŸ”₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.

fix error while switching grouped by (#4843)

rahulramesha072e8213f057
diff --git a/web/core/hooks/use-multiple-select.ts b/web/core/hooks/use-multiple-select.ts
index f6bb3df9ae..b985a19dde 100644
--- a/web/core/hooks/use-multiple-select.ts
+++ b/web/core/hooks/use-multiple-select.ts
@@ -250,7 +250,7 @@ export const useMultipleSelect = (props: Props) => {
const isGroupSelected = useCallback(
(groupID: string) => {
const groupEntities = entitiesList.filter((entity) => entity.groupID === groupID);
- const totalSelected = groupEntities.filter((entity) => getIsEntitySelected(entity.entityID ?? "")).length;
+ const totalSelected = groupEntities.filter((entity) => getIsEntitySelected(entity?.entityID ?? "")).length;
if (totalSelected === 0) return "empty";
if (totalSelected === groupEntities.length) return "complete";
return "partial";
@@ -359,7 +359,7 @@ export const useMultipleSelect = (props: Props) => {
useEffect(() => {
if (disabled) return;
selectedEntityIds.map((entityID) => {
- const isEntityPresent = entitiesList.find((en) => en.entityID === entityID);
+ const isEntityPresent = entitiesList.find((en) => en?.entityID === entityID);
if (!isEntityPresent) {
const entityDetails = getEntityDetailsFromEntityID(entityID);
if (entityDetails) {