From 8cbe6c4b36047b47fae39587d0d2bf77803997df Mon Sep 17 00:00:00 2001 From: Aaryan Khandelwal <65252264+aaryan610@users.noreply.github.com> Date: Sat, 20 May 2023 03:07:00 +0530 Subject: [PATCH] fix: show only filtered states when state filter is selected (#1093) --- apps/app/hooks/use-issues-view.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/app/hooks/use-issues-view.tsx b/apps/app/hooks/use-issues-view.tsx index 406c1d025..0e27ed049 100644 --- a/apps/app/hooks/use-issues-view.tsx +++ b/apps/app/hooks/use-issues-view.tsx @@ -129,9 +129,12 @@ const useIssuesView = () => { ? backlogStatesList.map((state) => state.id) : statesList.map((state) => state.id); + const filteredStateIds = + filters && filters?.state ? stateIds.filter((s) => filters.state?.includes(s)) : stateIds; + const emptyStatesObject: { [key: string]: [] } = {}; - for (let i = 0; i < stateIds.length; i++) { - emptyStatesObject[stateIds[i]] = []; + for (let i = 0; i < filteredStateIds.length; i++) { + emptyStatesObject[filteredStateIds[i]] = []; } const groupedByIssues: