Break the tasks

This commit is contained in:
Lim Chee Aun 2024-05-28 22:22:14 +08:00
parent b6a64b66c7
commit 563b06e680
2 changed files with 3 additions and 3 deletions

View file

@ -63,7 +63,7 @@ function Avatar({ url, size, alt = '', squircle, ...props }) {
if (avatarRef.current) avatarRef.current.dataset.loaded = true;
if (alphaCache[url] !== undefined) return;
if (isMissing) return;
queueMicrotask(() => {
setTimeout(() => {
try {
// Check if image has alpha channel
const { width, height } = e.target;
@ -88,7 +88,7 @@ function Avatar({ url, size, alt = '', squircle, ...props }) {
// Silent fail
alphaCache[url] = false;
}
});
}, 1);
}}
/>
)}

View file

@ -34,7 +34,7 @@ export default function Modals() {
const location = useLocation();
useEffect(() => {
queueMicrotask(preload);
setTimeout(preload, 1);
}, []);
return (