@@ -67,12 +67,6 @@ export const DRepDirectoryContent: FC<DRepDirectoryContentProps> = ({
6767 enabled : ! ! inProgressDelegation || ! ! currentDelegation ,
6868 } ) ;
6969
70- const { dRep : yourselfDRep } = useGetDRepDetailsQuery ( myDRepId , {
71- enabled : ! ! inProgressDelegation || ! ! currentDelegation ,
72- } ) ;
73- const showYourselfDRep =
74- debouncedSearchText === myDRepId || debouncedSearchText === "" ;
75-
7670 const {
7771 dRepData : dRepList ,
7872 isPreviousData,
@@ -106,21 +100,16 @@ export const DRepDirectoryContent: FC<DRepDirectoryContentProps> = ({
106100
107101 const ada = correctAdaFormat ( votingPower ) ;
108102
109- const listedDRepsWithoutYourself = uniqBy (
110- dRepList ?. filter (
111- ( dRep ) =>
112- ( typeof dRep . doNotList === "string"
113- ? ! parseBoolean ( dRep . doNotList )
114- : ! dRep . doNotList ) && ! isSameDRep ( dRep , myDRepId ) ,
115- ) ,
103+ const filteredDoNotListDReps = uniqBy (
104+ dRepList ?. filter ( ( dRep ) => {
105+ if ( typeof dRep . doNotList === "string" ) {
106+ return ! parseBoolean ( dRep . doNotList ) ;
107+ }
108+ return ! dRep . doNotList ;
109+ } ) ,
116110 "view" ,
117111 ) ;
118112
119- const dRepListToDisplay =
120- yourselfDRep && showYourselfDRep
121- ? [ yourselfDRep , ...listedDRepsWithoutYourself ]
122- : listedDRepsWithoutYourself ;
123-
124113 const isAnAutomatedVotingOptionChosen =
125114 currentDelegation ?. dRepView &&
126115 ( currentDelegation ?. dRepView ===
@@ -217,8 +206,8 @@ export const DRepDirectoryContent: FC<DRepDirectoryContentProps> = ({
217206 flex : 1 ,
218207 } }
219208 >
220- { dRepListToDisplay ?. length === 0 && < EmptyStateDrepDirectory /> }
221- { dRepListToDisplay ?. map ( ( dRep ) => (
209+ { filteredDoNotListDReps ?. length === 0 && < EmptyStateDrepDirectory /> }
210+ { filteredDoNotListDReps ?. map ( ( dRep ) => (
222211 < Box key = { dRep . view } component = "li" sx = { { listStyle : "none" } } >
223212 < DRepCard
224213 dRep = { dRep }
0 commit comments