Skip to content
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
4 changes: 2 additions & 2 deletions mobile/src/common/hooks/useRemoteConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const url = `${basePath}${isDev ? 'dev.json' : 'prod.json'}`
export const useRemoteConfig = () => {
const query = useQuery({
queryKey,
queryFn: async (): Promise<App.Config> => {
queryFn: async (): Promise<App.Config | undefined> => {
const response = await fetchData<App.Config>({
url,
})
Expand All @@ -25,7 +25,7 @@ export const useRemoteConfig = () => {
origin: 'useRemoteConfig',
response: response,
})
return {} as App.Config
return undefined
}

return response.value.data
Expand Down
4 changes: 2 additions & 2 deletions mobile/src/features/Airdrop/common/useAirdropEligibility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const useAirdropEligibility = () => {
!isByronWallet,
staleTime: time.fiveMinutes,
retry: false,
queryFn: async (): Promise<AddressAllocation[]> => {
queryFn: async (): Promise<AddressAllocation[] | undefined> => {
if (!wallet || !wallet.isMainnet) {
return []
}
Expand All @@ -57,7 +57,7 @@ export const useAirdropEligibility = () => {
addresses = wallet.receiveAddresses() || []
} catch (error) {
logger.warn('Failed to get receive addresses', {error})
return []
return undefined
}

if (addresses.length === 0) {
Expand Down
8 changes: 4 additions & 4 deletions mobile/src/features/Pairing/hooks/usePrimaryTokenActivity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ export const usePrimaryTokenActivity = ({
options,
}: {
to: Portfolio.Currency.Symbol
options?: UseQueryOptions<PrimaryTokenActivity, Error>
options?: UseQueryOptions<PrimaryTokenActivity | undefined, Error>
}) => {
const query = useQuery({
const query = useQuery<PrimaryTokenActivity | undefined, Error>({
enabled: to !== ptTicker,
staleTime: time.oneMinute,
retryDelay: time.oneSecond,
refetchInterval: time.oneMinute,
queryKey: [persistPrefixKeyword, 'usePrimaryTokenActivity', to],
...options,
queryFn: async () => {
queryFn: async (): Promise<PrimaryTokenActivity | undefined> => {
const response = await fetchPtPriceActivity([
Date.now(),
Date.now() - time.oneDay,
Expand All @@ -39,7 +39,7 @@ export const usePrimaryTokenActivity = ({
}
}

return defaultPrimaryTokenActivity
return undefined
},
})

Expand Down
Loading