fix and update
This commit is contained in:
@@ -11,11 +11,11 @@ interface AvatarAccessResponse {
|
||||
}
|
||||
|
||||
export function useAvatarUrl(userId: string | undefined, hasAvatar: boolean | undefined, token: string | null) {
|
||||
const { isPinLocked } = useAuth();
|
||||
const { isPinLocked, isLoading } = useAuth();
|
||||
const [avatarUrl, setAvatarUrl] = useState<string | null>(null);
|
||||
|
||||
const refresh = useCallback(async () => {
|
||||
if (!userId || !token || !hasAvatar || isPinLocked) {
|
||||
if (!userId || !token || !hasAvatar || isPinLocked || isLoading) {
|
||||
setAvatarUrl(null);
|
||||
return;
|
||||
}
|
||||
@@ -25,7 +25,7 @@ export function useAvatarUrl(userId: string | undefined, hasAvatar: boolean | un
|
||||
} catch {
|
||||
setAvatarUrl(null);
|
||||
}
|
||||
}, [hasAvatar, isPinLocked, token, userId]);
|
||||
}, [hasAvatar, isLoading, isPinLocked, token, userId]);
|
||||
|
||||
useEffect(() => {
|
||||
void refresh();
|
||||
|
||||
Reference in New Issue
Block a user