pl-fe: do not process avatar colors when the user is not a cat

Signed-off-by: Nicole Mikołajczyk <git@mkljczk.pl>
This commit is contained in:
Nicole Mikołajczyk
2025-04-10 10:18:52 +02:00
parent 1eaa5f0ded
commit 28933f5612

View File

@ -36,6 +36,8 @@ const Avatar = (props: IAvatar) => {
const handleLoadFailure = () => setIsAvatarMissing(true);
useEffect(() => {
if (!isCat) return;
if (COLOR_CACHE.has(src)) {
setColor(COLOR_CACHE.get(src));
return;
@ -47,7 +49,7 @@ const Avatar = (props: IAvatar) => {
setColor(color.hex);
}
}).catch(() => setColor(undefined));
}, [src]);
}, [src, isCat]);
const style: React.CSSProperties = React.useMemo(() => ({
width: size,