fixxxxxxxx
This commit is contained in:
@@ -12,21 +12,25 @@ export function useCurrentAccount(): UserProfileDetails | null | false {
|
||||
const query = useQuery<UserProfileDetails | false>({
|
||||
queryKey: ["currentAccount"],
|
||||
queryFn: async () => {
|
||||
const authed = await getLoggedInUser();
|
||||
if (!authed) return false;
|
||||
try {
|
||||
const authed = await getLoggedInUser();
|
||||
if (!authed) return false;
|
||||
|
||||
const user = await getUserByUserId(authed.id.toString());
|
||||
const user = await getUserByUserId(authed.id.toString());
|
||||
|
||||
loadThumbnails([
|
||||
{
|
||||
type: "AvatarHeadShot",
|
||||
targetId: authed.id,
|
||||
format: "webp",
|
||||
size: "720x720"
|
||||
}
|
||||
]).catch(() => {});
|
||||
loadThumbnails([
|
||||
{
|
||||
type: "AvatarHeadShot",
|
||||
targetId: authed.id,
|
||||
format: "webp",
|
||||
size: "720x720"
|
||||
}
|
||||
]).catch(() => {});
|
||||
|
||||
return user;
|
||||
return user;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
staleTime: 1000 * 60 * 5,
|
||||
refetchOnWindowFocus: false
|
||||
|
||||
Reference in New Issue
Block a user