your personal website on atproto - mirror blento.app

fix invalid handle

Florian 02917554 cf7ab30f

+14 -2
+5 -1
src/lib/atproto/methods.ts
··· 93 93 params: { actor: data.did } 94 94 }); 95 95 96 - if (!response.ok) return; 96 + if (!response.ok || response.data.handle === 'handle.invalid') { 97 + // fall back to describe repo 98 + const repo = await describeRepo({ did: data.did, client: data.client }); 99 + return { handle: repo?.handle ?? 'handle.invalid', did: data.did }; 100 + } 97 101 98 102 return response.data; 99 103 }
+9 -1
src/lib/cards/SpecialCards/UpdatedBlentos/index.ts
··· 30 30 for (const did of Array.from(uniqueDids)) { 31 31 const profile = getDetailedProfile({ did }); 32 32 profiles.push(profile); 33 - if (profiles.length > 20) break; 33 + if (profiles.length > 30) break; 34 + } 35 + 36 + for (let i = existingUsersArray.length - 1; i >= 0; i--) { 37 + // if handle is handle.invalid, remove from existing users and add to profiles to refresh 38 + if (existingUsersArray[i].handle === 'handle.invalid') { 39 + const removed = existingUsersArray.splice(i, 1)[0]; 40 + profiles.push(getDetailedProfile({ did: removed.did })); 41 + } 34 42 } 35 43 36 44 const result = [...(await Promise.all(profiles)), ...existingUsersArray];