Skip to content

ref(avatar): Migrate Gravatar hash to useQuery#109784

Merged
JonasBa merged 4 commits intomasterfrom
jb/imageavatar/usequery
Mar 3, 2026
Merged

ref(avatar): Migrate Gravatar hash to useQuery#109784
JonasBa merged 4 commits intomasterfrom
jb/imageavatar/usequery

Conversation

@JonasBa
Copy link
Member

@JonasBa JonasBa commented Mar 3, 2026

Replace the useState + useEffect pattern in useGravatarHash with useQuery from TanStack Query.

The hash computation is now cached with staleTime: Infinity so it is computed once per unique gravatarId and never refetched. networkMode: 'always' ensures the query runs regardless of network state (the hash is computed locally via window.crypto.subtle), and retry: 0 avoids retrying on crypto errors.

Replace the useState + useEffect pattern in the Gravatar component
with useQuery from TanStack Query. The hash is now cached with
staleTime: Infinity so it never refetches for the same gravatarId.

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Mar 3, 2026
@JonasBa JonasBa marked this pull request as ready for review March 3, 2026 16:03
@JonasBa JonasBa requested a review from a team as a code owner March 3, 2026 16:03
JonasBa and others added 2 commits March 3, 2026 08:09
Replace the useState + useEffect pattern in useGravatarHash with an
inline useQuery call. The hash is now cached with staleTime: Infinity
so it never refetches for the same gravatarId.

Co-Authored-By: Claude <noreply@anthropic.com>
@JonasBa JonasBa merged commit abb2fe5 into master Mar 3, 2026
60 checks passed
@JonasBa JonasBa deleted the jb/imageavatar/usequery branch March 3, 2026 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants