your personal website on atproto - mirror blento.app

dont show empty blentos in random

Florian 0bce754a e4b3bc28

+3 -1
+3 -1
src/routes/random/+page.server.ts
··· 14 14 let foundData: WebsiteData | undefined = undefined; 15 15 let i = 0; 16 16 17 - while (!foundData && i < 10) { 17 + while (!foundData && i < 20) { 18 18 const rando = Math.floor(Math.random() * list.keys.length); 19 19 20 20 foundData = await getCache(list.keys[rando].name, 'self', cache as unknown as UserCache); 21 + 22 + if (!foundData?.cards.length) foundData = undefined; 21 23 i++; 22 24 } 23 25