fix claim flicker when no claim

This commit is contained in:
saml33 2023-10-19 22:46:19 +11:00
parent 26baa956dd
commit 3dc7a7edd4
4 changed files with 11 additions and 13 deletions

View File

@ -30,19 +30,18 @@ const Season = ({
}: {
setShowLeaderboards: (x: string) => void
}) => {
const { t } = useTranslation(['common', 'rewards'])
const { t } = useTranslation(['common', 'governance', 'rewards'])
const { wallet } = useWallet()
const faqRef = useRef<HTMLDivElement>(null)
const { mangoAccountAddress } = useMangoAccount()
const [topAccountsTier, setTopAccountsTier] = useState('')
const { data: seasonData, isLoading: loadingSeasonData } = useCurrentSeason()
const { data: accountTier, isLoading: loadingAccountTier } = useAccountTier(
mangoAccountAddress,
seasonData?.season_id,
)
const { data: seasonData, isInitialLoading: loadingSeasonData } =
useCurrentSeason()
const { data: accountTier, isInitialLoading: loadingAccountTier } =
useAccountTier(mangoAccountAddress, seasonData?.season_id)
const {
data: accountPointsAndRank,
isLoading: loadingAccountPointsAndRank,
isInitialLoading: loadingAccountPointsAndRank,
refetch,
} = useAccountPointsAndRank(mangoAccountAddress, seasonData?.season_id)
@ -187,7 +186,7 @@ const Season = ({
</span>
) : (
<span className="flex items-center justify-center text-center font-body text-sm text-th-fgd-3">
{t('connect-wallet')}
{t('governance:connect-wallet')}
</span>
)
) : (

View File

@ -100,8 +100,6 @@ const BalancesTable = () => {
sortConfig,
} = useSortableData(formattedTableData())
console.log(tableData)
return filteredBanks.length ? (
showTableView ? (
<Table>

View File

@ -78,7 +78,7 @@ export const useWalletPoints = (
staleTime: 1000 * 60,
retry: 3,
refetchOnWindowFocus: false,
enabled: !!wallet?.adapter && !!mangoAccountAddress,
enabled: !!(wallet?.adapter && mangoAccountAddress),
},
)
}
@ -101,7 +101,7 @@ export const useIsAllClaimed = (
prevSeason: number | undefined,
walletPk: PublicKey | null,
) => {
const [isAllClaimed, setIsAllCliamed] = useState(false)
const [isAllClaimed, setIsAllCliamed] = useState(true)
const { data: distributionDataAndClient } = useDistribution(prevSeason)
const distributionData = distributionDataAndClient?.distribution

View File

@ -9,6 +9,7 @@ export async function getStaticProps({ locale }: { locale: string }) {
props: {
...(await serverSideTranslations(locale, [
'common',
'governance',
'notifications',
'onboarding',
'profile',
@ -27,7 +28,7 @@ const Rewards: NextPage = () => {
<div
className={`pb-20 md:pb-0 ${themeData.fonts.rewards.variable} font-sans`}
>
{isWhiteListed && <RewardsPage />}
{isWhiteListed ? <RewardsPage /> : null}
</div>
)
}