mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-19 05:55:34 +09:00
fix(app): back off image, reaction and settings retries on 429 (#2743)
This commit is contained in:
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(() => {
|
||||
|
||||
Reference in new issue
Block a user