Skip to content

Commit

Permalink
[HOTFIX] FE fetching uq from currentepoch (#333)
Browse files Browse the repository at this point in the history
  • Loading branch information
aziolek authored Jul 16, 2024
2 parents 53e5125 + 7685c08 commit cd60561
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ const AllocationItemRewards: FC<AllocationItemRewardsProps> = ({
const { data: userAllocations } = useUserAllocations();
const { data: isDecisionWindowOpen } = useIsDecisionWindowOpen();
const { data: matchedProjectRewards } = useMatchedProjectRewards();
const { data: uqScore } = useUqScore(isDecisionWindowOpen ? currentEpoch! - 1 : currentEpoch!);
const { data: uqScore } = useUqScore(currentEpoch!);

const { data: projectDonors } = useProjectDonors(address);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,12 @@ const AllocationTipTiles: FC<AllocationTipTilesProps> = ({ className }) => {
const { data: isDecisionWindowOpen } = useIsDecisionWindowOpen();
const { data: individualReward, isFetching: isFetchingIndividualReward } = useIndividualReward();
const { data: userAllocations, isFetching: isFetchingUserAllocation } = useUserAllocations();
const { data: uqScore, isFetching: isFetchingUqScore } = useUqScore(
isDecisionWindowOpen ? currentEpoch! - 1 : currentEpoch!,
{
enabled:
isSuccessRefreshAntisybilStatus ||
(refreshAntisybilStatusError as null | { message: string })?.message ===
'Address is already used for delegation',
},
);
const { data: uqScore, isFetching: isFetchingUqScore } = useUqScore(currentEpoch!, {
enabled:
isSuccessRefreshAntisybilStatus ||
(refreshAntisybilStatusError as null | { message: string })?.message ===
'Address is already used for delegation',
});
const {
wasRewardsAlreadyClosed,
setWasRewardsAlreadyClosed,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { DELEGATION_MIN_SCORE } from 'constants/delegation';
import useRefreshAntisybilStatus from 'hooks/mutations/useRefreshAntisybilStatus';
import useAntisybilStatusScore from 'hooks/queries/useAntisybilStatusScore';
import useCurrentEpoch from 'hooks/queries/useCurrentEpoch';
import useIsDecisionWindowOpen from 'hooks/queries/useIsDecisionWindowOpen';
import useUqScore from 'hooks/queries/useUqScore';
import useUserTOS from 'hooks/queries/useUserTOS';
import useSettingsStore from 'store/settings/store';
Expand Down Expand Up @@ -40,13 +39,12 @@ const SettingsRecalculatingScore: FC<SettingsRecalculatingScoreProps> = ({ onLas
useAntisybilStatusScore(isDelegationCompleted ? delegationSecondaryAddress! : address!, {
enabled: isSuccessRefreshAntisybilStatus,
});
const { data: isDecisionWindowOpen } = useIsDecisionWindowOpen();

const {
data: uqScore,
isFetching: isFetchingUqScore,
isError: isErrorUqScore,
} = useUqScore(isDecisionWindowOpen ? currentEpoch! - 1 : currentEpoch!, {
} = useUqScore(currentEpoch!, {
enabled: isSuccessAntisybilStatusScore,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import useCheckDelegation from 'hooks/mutations/useCheckDelegation';
import useRefreshAntisybilStatus from 'hooks/mutations/useRefreshAntisybilStatus';
import useAntisybilStatusScore from 'hooks/queries/useAntisybilStatusScore';
import useCurrentEpoch from 'hooks/queries/useCurrentEpoch';
import useIsDecisionWindowOpen from 'hooks/queries/useIsDecisionWindowOpen';
import useUqScore from 'hooks/queries/useUqScore';
import useUserTOS from 'hooks/queries/useUserTOS';
import toastService from 'services/toastService';
Expand All @@ -30,11 +29,8 @@ const SettingsUniquenessScoreBox = (): ReactNode => {
const connectors = useConnectors();
const { data: currentEpoch } = useCurrentEpoch();
const { data: isUserTOSAccepted } = useUserTOS();
const { data: isDecisionWindowOpen } = useIsDecisionWindowOpen();

const { data: uqScore, isFetching: isFetchingUqScore } = useUqScore(
isDecisionWindowOpen ? currentEpoch! - 1 : currentEpoch!,
);
const { data: uqScore, isFetching: isFetchingUqScore } = useUqScore(currentEpoch!);

const [isRecalculatingScoreModalOpen, setIisRecalculatingScoreModalOpen] = useState(false);
const [isCalculatingYourUniquenessModalOpen, setIsCalculatingYourUniquenessModalOpen] =
Expand Down

0 comments on commit cd60561

Please sign in to comment.