@@ -86,12 +86,17 @@ const SettingsUniquenessScoreBox = (): ReactNode => {
8686 } = useRefreshAntisybilStatus ( ) ;
8787
8888 const { data : antisybilStatusScore , isSuccess : isSuccessAntisybilStatusScore } =
89- useAntisybilStatusScore ( isDelegationCompleted ? delegationSecondaryAddress ! : address ! , {
90- enabled :
91- isSuccessRefreshAntisybilStatus ||
92- ( refreshAntisybilStatusError as null | { message : string } ) ?. message ===
93- 'Address is already used for delegation' ,
94- } ) ;
89+ useAntisybilStatusScore (
90+ isDelegationCompleted && delegationSecondaryAddress !== '0x???'
91+ ? delegationSecondaryAddress !
92+ : address ! ,
93+ {
94+ enabled :
95+ isSuccessRefreshAntisybilStatus ||
96+ ( refreshAntisybilStatusError as null | { message : string } ) ?. message ===
97+ 'Address is already used for delegation' ,
98+ } ,
99+ ) ;
95100
96101 const checkDelegation = async ( ) => {
97102 if ( ! isUserTOSAccepted ) {
@@ -139,6 +144,10 @@ const SettingsUniquenessScoreBox = (): ReactNode => {
139144 if ( isDelegationCompleted ) {
140145 setSecondaryAddressScore ( antisybilStatusScore ) ;
141146 } else {
147+ if ( refreshAntisybilStatusError ) {
148+ setDelegationPrimaryAddress ( address ) ;
149+ setDelegationSecondaryAddress ( '0x???' ) ;
150+ }
142151 setPrimaryAddressScore (
143152 antisybilStatusScore < DELEGATION_MIN_SCORE && uqScore === 100n
144153 ? DELEGATION_MIN_SCORE
@@ -147,7 +156,7 @@ const SettingsUniquenessScoreBox = (): ReactNode => {
147156 }
148157 setIsFetchingScore ( false ) ;
149158 // eslint-disable-next-line react-hooks/exhaustive-deps
150- } , [ isSuccessAntisybilStatusScore , isFetchingUqScore ] ) ;
159+ } , [ isSuccessAntisybilStatusScore , isFetchingUqScore , refreshAntisybilStatusError ] ) ;
151160
152161 useEffect ( ( ) => {
153162 if (
@@ -208,7 +217,12 @@ const SettingsUniquenessScoreBox = (): ReactNode => {
208217 < div className = { styles . buttonsWrapper } >
209218 < Button
210219 className = { styles . button }
211- isDisabled = { isDelegationCompleted || isFetchingScore || isFetchingUqScore }
220+ isDisabled = {
221+ isDelegationCompleted ||
222+ isFetchingScore ||
223+ isFetchingUqScore ||
224+ delegationSecondaryAddress === '0x???'
225+ }
212226 isHigh
213227 onClick = { ( ) => setIisRecalculatingScoreModalOpen ( true ) }
214228 variant = "cta"
@@ -224,7 +238,8 @@ const SettingsUniquenessScoreBox = (): ReactNode => {
224238 primaryAddressScore === undefined ||
225239 primaryAddressScore >= 20 ||
226240 isFetchingUqScore ||
227- uqScore === 100n
241+ uqScore === 100n ||
242+ delegationSecondaryAddress === '0x???'
228243 }
229244 isHigh
230245 onClick = { ( ) => {
0 commit comments