|
1 | | -import { useState, useEffect, useCallback, useMemo } from "react"; |
| 1 | +import { useState, useEffect, useCallback } from "react"; |
2 | 2 | import { Box, CircularProgress, Tab, Tabs, styled } from "@mui/material"; |
3 | 3 | import { useLocation, useNavigate } from "react-router-dom"; |
4 | 4 |
|
@@ -107,33 +107,7 @@ export const DashboardGovernanceActions = () => { |
107 | 107 | debouncedSearchText, |
108 | 108 | ); |
109 | 109 |
|
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; |
137 | 111 |
|
138 | 112 | const { state } = useLocation(); |
139 | 113 | const [content, setContent] = useState<number>( |
|
0 commit comments