From 2b7a6c4012c84e30b386111af2fc7a448b208199 Mon Sep 17 00:00:00 2001 From: bosko-m <88723596+bosko-m@users.noreply.github.com> Date: Wed, 23 Jul 2025 10:37:19 +0200 Subject: [PATCH 1/4] Update DashboardGovernanceActions.tsx Signed-off-by: bosko-m <88723596+bosko-m@users.noreply.github.com> --- .../src/components/organisms/DashboardGovernanceActions.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/govtool/frontend/src/components/organisms/DashboardGovernanceActions.tsx b/govtool/frontend/src/components/organisms/DashboardGovernanceActions.tsx index c129179a9..d2c28e9ea 100644 --- a/govtool/frontend/src/components/organisms/DashboardGovernanceActions.tsx +++ b/govtool/frontend/src/components/organisms/DashboardGovernanceActions.tsx @@ -107,6 +107,8 @@ export const DashboardGovernanceActions = () => { debouncedSearchText, ); + if (!votes) return proposals; + // TODO: Black magic - that filtering should be done on the backend const filteredProposals = proposals ?.map((proposalCategory) => { From 84a8fef08ee88af82a25cdee831834796492e756 Mon Sep 17 00:00:00 2001 From: bosko-m <88723596+bosko-m@users.noreply.github.com> Date: Wed, 23 Jul 2025 10:44:30 +0200 Subject: [PATCH 2/4] Update DashboardGovernanceActions.tsx Signed-off-by: bosko-m <88723596+bosko-m@users.noreply.github.com> --- .../src/components/organisms/DashboardGovernanceActions.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/govtool/frontend/src/components/organisms/DashboardGovernanceActions.tsx b/govtool/frontend/src/components/organisms/DashboardGovernanceActions.tsx index d2c28e9ea..f4d8261cc 100644 --- a/govtool/frontend/src/components/organisms/DashboardGovernanceActions.tsx +++ b/govtool/frontend/src/components/organisms/DashboardGovernanceActions.tsx @@ -108,7 +108,7 @@ export const DashboardGovernanceActions = () => { ); if (!votes) return proposals; - + // TODO: Black magic - that filtering should be done on the backend const filteredProposals = proposals ?.map((proposalCategory) => { From adc5d071c4427e801861042f7870d73c901ee508 Mon Sep 17 00:00:00 2001 From: bosko-m <88723596+bosko-m@users.noreply.github.com> Date: Wed, 23 Jul 2025 11:20:54 +0200 Subject: [PATCH 3/4] Update DashboardGovernanceActions.tsx Signed-off-by: bosko-m <88723596+bosko-m@users.noreply.github.com> --- .../organisms/DashboardGovernanceActions.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/govtool/frontend/src/components/organisms/DashboardGovernanceActions.tsx b/govtool/frontend/src/components/organisms/DashboardGovernanceActions.tsx index f4d8261cc..f86ed5e84 100644 --- a/govtool/frontend/src/components/organisms/DashboardGovernanceActions.tsx +++ b/govtool/frontend/src/components/organisms/DashboardGovernanceActions.tsx @@ -107,13 +107,14 @@ export const DashboardGovernanceActions = () => { debouncedSearchText, ); + //White Magic :) + const filterOutAlreadyVotedProposals = () => { if (!votes) return proposals; - // TODO: Black magic - that filtering should be done on the backend - const filteredProposals = proposals + return proposals ?.map((proposalCategory) => { const filteredActions = proposalCategory.actions.filter((action) => { - const hasVote = votes?.some((voteCategory) => + const hasVote = votes.some((voteCategory) => voteCategory.actions.some( (voteAction) => voteAction.proposal.txHash === action.txHash && @@ -130,6 +131,9 @@ export const DashboardGovernanceActions = () => { }; }) .filter((category) => category.actions.length > 0); +}; + +const filteredProposals = filterOutAlreadyVotedProposals(); const { state } = useLocation(); const [content, setContent] = useState( From b1049f9f0d7e5d7ed8ade7f1a20430f20ae4b09d Mon Sep 17 00:00:00 2001 From: bosko-m <88723596+bosko-m@users.noreply.github.com> Date: Wed, 23 Jul 2025 11:23:19 +0200 Subject: [PATCH 4/4] Update DashboardGovernanceActions.tsx Signed-off-by: bosko-m <88723596+bosko-m@users.noreply.github.com> --- .../src/components/organisms/DashboardGovernanceActions.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/govtool/frontend/src/components/organisms/DashboardGovernanceActions.tsx b/govtool/frontend/src/components/organisms/DashboardGovernanceActions.tsx index f86ed5e84..838123327 100644 --- a/govtool/frontend/src/components/organisms/DashboardGovernanceActions.tsx +++ b/govtool/frontend/src/components/organisms/DashboardGovernanceActions.tsx @@ -107,7 +107,7 @@ export const DashboardGovernanceActions = () => { debouncedSearchText, ); - //White Magic :) + // White Magic :) const filterOutAlreadyVotedProposals = () => { if (!votes) return proposals;