Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HOTFIX] FE fetching uq from currentepoch #333

Merged
merged 1 commit into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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