diff --git a/src/components/common/AnimatedIcon.tsx b/src/components/common/AnimatedIcon.tsx index d9917834..2a25f398 100644 --- a/src/components/common/AnimatedIcon.tsx +++ b/src/components/common/AnimatedIcon.tsx @@ -55,7 +55,7 @@ function AnimatedIcon(props: OwnProps) { return ( - & { previewUrl?: string; thumbDataUri?: string }; + & { previewUrl?: string; thumbDataUri?: string; noPreviewTransition?: boolean }; + +const loadedPreviewUrls = new Set(); function AnimatedIconWithPreview(props: OwnProps) { const { - previewUrl, thumbDataUri, className, ...otherProps + previewUrl, thumbDataUri, noPreviewTransition, className, ...otherProps } = props; - const transitionClassNames = useMediaTransition(previewUrl); + const [isPreviewLoaded, markPreviewLoaded] = useFlag(loadedPreviewUrls.has(previewUrl)); + const previewClassNames = useMediaTransition(noPreviewTransition || isPreviewLoaded); const [isAnimationReady, markAnimationReady] = useFlag(false); + + const handlePreviewLoad = useCallback(() => { + markPreviewLoaded(); + loadedPreviewUrls.add(previewUrl); + }, [markPreviewLoaded, previewUrl]); + const { size } = props; return ( @@ -34,7 +43,11 @@ function AnimatedIconWithPreview(props: OwnProps) { )} {!isAnimationReady && ( // eslint-disable-next-line jsx-a11y/alt-text - + )} {/* eslint-disable-next-line react/jsx-props-no-spreading */} diff --git a/src/components/left/settings/SettingsPrivacy.tsx b/src/components/left/settings/SettingsPrivacy.tsx index 4c5d32eb..8f416d4b 100644 --- a/src/components/left/settings/SettingsPrivacy.tsx +++ b/src/components/left/settings/SettingsPrivacy.tsx @@ -137,29 +137,20 @@ const SettingsPrivacy: FC = ({
onScreenSelect(SettingsScreens.PrivacyBlockedUsers)} > -
- {lang('BlockedUsers')} - {blockedCount > 0 && ( - - {lang('Users', blockedCount)} - - )} -
+ {lang('BlockedUsers')} + {blockedCount || ''} +
+ onScreenSelect(SettingsScreens.ActiveWebsites)} + > + {lang('PrivacySettings.WebSessions')} + {webAuthCount || ''} - {webAuthCount > 0 && ( - onScreenSelect(SettingsScreens.ActiveWebsites)} - > - {lang('PrivacySettings.WebSessions')} - {webAuthCount} - - )}