Skip to content

Commit e39ac50

Browse files
authored
Merge pull request #3959 from IntersectMBO/3918-3956-removes-double-filtering-of-proposals
Update DashboardGovernanceActions.tsx - removes double filtering of p…
2 parents 9fa3f14 + 74f6b97 commit e39ac50

File tree

1 file changed

+2
-28
lines changed

1 file changed

+2
-28
lines changed

govtool/frontend/src/components/organisms/DashboardGovernanceActions.tsx

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useState, useEffect, useCallback, useMemo } from "react";
1+
import { useState, useEffect, useCallback } from "react";
22
import { Box, CircularProgress, Tab, Tabs, styled } from "@mui/material";
33
import { useLocation, useNavigate } from "react-router-dom";
44

@@ -107,33 +107,7 @@ export const DashboardGovernanceActions = () => {
107107
debouncedSearchText,
108108
);
109109

110-
// White Magic :)
111-
const shouldFilter =
112-
voter?.isRegisteredAsDRep || voter?.isRegisteredAsSoleVoter;
113-
114-
const filteredProposals = useMemo(() => {
115-
if (!shouldFilter || !proposals || !votes) return proposals;
116-
117-
return proposals
118-
.map((proposalCategory) => {
119-
const filteredActions = proposalCategory.actions.filter((action) => {
120-
const hasVote = votes.some((voteCategory) =>
121-
voteCategory.actions.some(
122-
(voteAction) =>
123-
voteAction.proposal.txHash === action.txHash &&
124-
voteAction.proposal.index === action.index,
125-
),
126-
);
127-
return !hasVote;
128-
});
129-
130-
return {
131-
...proposalCategory,
132-
actions: filteredActions,
133-
};
134-
})
135-
.filter((category) => category.actions.length > 0);
136-
}, [proposals, votes, shouldFilter]);
110+
const filteredProposals = proposals;
137111

138112
const { state } = useLocation();
139113
const [content, setContent] = useState<number>(

0 commit comments

Comments
 (0)