fix and update

This commit is contained in:
lendry
2026-06-29 21:22:20 +03:00
parent 7233e8b70a
commit 8369abb023
7 changed files with 98 additions and 23 deletions

View File

@@ -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();