fix(app): back off image, reaction and settings retries on 429 (#2743)

This commit is contained in:
Hampus Kraft committed 2026-09-13 21:04:31 +02:00
1 parent ca7ddd9272
commit d14998ff69
5 files changed
+129 -44

No files matched your search

@@ -175,7 +175,7 @@ export const BaseAvatar = React.forwardRef<HTMLDivElement, BaseAvatarProps>(
const maskIsMobileOnline = shouldShowCustomStatusBadge ? false : isMobileOnline;
const reducedMotion = Accessibility.useReducedMotion;
const candidateUrl = animatedMediaPlaybackEnabled ? hoverAvatarUrl || '' : avatarUrl;
const [imgError, setImgError] = useState(false);
const [imgError, setImgError] = useState(() => ImageCacheUtils.hasFailedImage(candidateUrl));
const [imgRetryCount, setImgRetryCount] = useState(0);
const [wasCachedAtMount] = useState(() => ImageCacheUtils.hasImage(candidateUrl));
const [mountedAt] = useState(() => Date.now());
@@ -183,7 +183,7 @@ export const BaseAvatar = React.forwardRef<HTMLDivElement, BaseAvatarProps>(
wasCachedAtMount ? {url: candidateUrl, fade: 'instant'} : null,
);
useEffect(() => {
setImgError(false);
setImgError(ImageCacheUtils.hasFailedImage(candidateUrl));
setImgRetryCount(0);
}, [candidateUrl]);
useEffect(() => {