Skip to content

Commit

Permalink
fix loop api
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenhoaidanh committed Oct 2, 2023
1 parent 8cd1dbd commit 51dd5f6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/state/user/hooks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -497,21 +497,21 @@ const participantDefault = {
}
export const useGetParticipantKyberAIInfo = (): ParticipantInfo => {
const { userInfo } = useSessionInfo()
const { data: data = participantDefault, isError } = useGetParticipantInfoQuery(undefined, {
const { currentData } = useGetParticipantInfoQuery(undefined, {
skip: !userInfo,
})
return isError ? participantDefault : data
return currentData || participantDefault
}

export const useIsWhiteListKyberAI = () => {
const { isLogin, pendingAuthentication, userInfo } = useSessionInfo()
const {
data: rawData,
currentData: rawData,
isFetching,
isError,
refetch,
} = useGetParticipantInfoQuery(undefined, {
skip: !userInfo,
skip: !userInfo || userInfo?.data?.hasAccessToKyberAI,
})

const { account } = useActiveWeb3React()
Expand Down

0 comments on commit 51dd5f6

Please sign in to comment.