From 6f45eddc93ec38794e4cadd8d9b014a1280b9090 Mon Sep 17 00:00:00 2001 From: bosko-m <88723596+bosko-m@users.noreply.github.com> Date: Fri, 25 Jul 2025 02:23:29 +0200 Subject: [PATCH 1/2] Update DashboardGovernanceActions.tsx - removes double filtering of proposals Signed-off-by: bosko-m <88723596+bosko-m@users.noreply.github.com> --- .../organisms/DashboardGovernanceActions.tsx | 24 +------------------ 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/govtool/frontend/src/components/organisms/DashboardGovernanceActions.tsx b/govtool/frontend/src/components/organisms/DashboardGovernanceActions.tsx index 878527c02..d7d7092db 100644 --- a/govtool/frontend/src/components/organisms/DashboardGovernanceActions.tsx +++ b/govtool/frontend/src/components/organisms/DashboardGovernanceActions.tsx @@ -111,29 +111,7 @@ export const DashboardGovernanceActions = () => { const shouldFilter = voter?.isRegisteredAsDRep || voter?.isRegisteredAsSoleVoter; -const filteredProposals = useMemo(() => { - if (!shouldFilter || !proposals || !votes) return proposals; - - return proposals - .map((proposalCategory) => { - const filteredActions = proposalCategory.actions.filter((action) => { - const hasVote = votes.some((voteCategory) => - voteCategory.actions.some( - (voteAction) => - voteAction.proposal.txHash === action.txHash && - voteAction.proposal.index === action.index, - ), - ); - return !hasVote; - }); - - return { - ...proposalCategory, - actions: filteredActions, - }; - }) - .filter((category) => category.actions.length > 0); -}, [proposals, votes, shouldFilter]); +const filteredProposals = proposals; const { state } = useLocation(); const [content, setContent] = useState( From 74f6b97806f65c507de15ed436f6eac89387c6f5 Mon Sep 17 00:00:00 2001 From: bosko-m <88723596+bosko-m@users.noreply.github.com> Date: Fri, 25 Jul 2025 02:45:30 +0200 Subject: [PATCH 2/2] Update DashboardGovernanceActions.tsx - lint checks fix Signed-off-by: bosko-m <88723596+bosko-m@users.noreply.github.com> --- .../src/components/organisms/DashboardGovernanceActions.tsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/govtool/frontend/src/components/organisms/DashboardGovernanceActions.tsx b/govtool/frontend/src/components/organisms/DashboardGovernanceActions.tsx index d7d7092db..b2e6e6fa4 100644 --- a/govtool/frontend/src/components/organisms/DashboardGovernanceActions.tsx +++ b/govtool/frontend/src/components/organisms/DashboardGovernanceActions.tsx @@ -1,4 +1,4 @@ -import { useState, useEffect, useCallback, useMemo } from "react"; +import { useState, useEffect, useCallback } from "react"; import { Box, CircularProgress, Tab, Tabs, styled } from "@mui/material"; import { useLocation, useNavigate } from "react-router-dom"; @@ -107,10 +107,6 @@ export const DashboardGovernanceActions = () => { debouncedSearchText, ); - // White Magic :) - const shouldFilter = - voter?.isRegisteredAsDRep || voter?.isRegisteredAsSoleVoter; - const filteredProposals = proposals; const { state } = useLocation();