Skip to content

Commit

Permalink
fix: Disable refresh and stale handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
richtera committed Jan 22, 2024
1 parent 842acf0 commit 7cbd59a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions ui/shared/entities/address/IdenticonUniversalProfileQuery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,16 @@ export const formattedLuksoName = (hash: string, name: string | null) => {
};

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export const useUniversalProfile = (address: string): UseQueryResult<any> => {
export const useUniversalProfile = (address: string): UseQueryResult<UniversalProfileProxyResponse | null> => {
return useQuery({
refetchOnWindowFocus: false,
refetchOnReconnect: false,
retryOnMount: false,
staleTime: Infinity,
queryKey: [ 'universalProfile', { address } ],
queryFn: async() => {
if (!isUniversalProfileEnabled()) {
return {};
return null;
}
const upApiUrl =
getEnvValue('NEXT_PUBLIC_UNIVERSAL_PROFILES_API_URL') || '';
Expand All @@ -35,7 +39,7 @@ export const useUniversalProfile = (address: string): UseQueryResult<any> => {
const json = await resp.json();
return json as UniversalProfileProxyResponse;
} catch (err) {
return undefined;
return null;
}
},
});
Expand Down

0 comments on commit 7cbd59a

Please sign in to comment.