the home of serif.blue
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: speed up verification

+14 -2
+14 -2
bluesky-community-verifications.user.js
··· 48 48 49 49 let isVerifiedByTrustedUser = false; 50 50 51 - for (const trustedUser of trustedUsers) { 51 + // Use Promise.all to fetch all verification data in parallel 52 + const verificationPromises = trustedUsers.map(async (trustedUser) => { 52 53 try { 53 54 const response = await fetch( 54 55 `https://bsky.social/xrpc/com.atproto.repo.listRecords?repo=${trustedUser}&collection=app.bsky.graph.verification`, 55 56 ); 56 57 const data = await response.json(); 57 58 59 + // Check if this trusted user has verified the current profile 58 60 if (data.records && data.records.length > 0) { 59 61 for (const record of data.records) { 60 62 if (record.value && record.value.subject === currentProfileDid) { ··· 68 70 } 69 71 } 70 72 } 73 + return { trustedUser, success: true }; 71 74 } catch (error) { 72 75 console.error( 73 76 `Error checking verifications from ${trustedUser}:`, 74 77 error, 75 78 ); 79 + return { trustedUser, success: false, error }; 76 80 } 77 - } 81 + }); 82 + 83 + // Wait for all verification checks to complete 84 + const results = await Promise.all(verificationPromises); 85 + 86 + // Log summary of API calls 87 + console.log(`API calls completed: ${results.length}`); 88 + console.log(`Successful calls: ${results.filter((r) => r.success).length}`); 89 + console.log(`Failed calls: ${results.filter((r) => !r.success).length}`); 78 90 79 91 // If we have verifiers, display the badge 80 92 if (profileVerifiers.length > 0) {