a simple pds frontend for listing accounts and generating invite codes
1
fork

Configure Feed

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

fix account listing to work with no data accounts

Winter f33894b8 2c495d22

+23 -9
+23 -9
src/routes/+page.server.ts
··· 10 10 avatarUrl: string; 11 11 } 12 12 13 + const LIMIT = 1000; 14 + 13 15 export const load: PageServerLoad = async () => { 14 - const [listResult, describeServer] = await Promise.all([ 15 - publicRpc.get('com.atproto.sync.listRepos', { 16 - params: { limit: 1000 }, 17 - }), 18 - publicRpc.get('com.atproto.server.describeServer', {}).catch(() => null), 19 - ]); 16 + const describeServer = await publicRpc 17 + .get('com.atproto.server.describeServer', {}) 18 + .catch(() => null); 20 19 21 20 const contactEmail = 22 21 describeServer?.data?.contact && ··· 24 23 ? (describeServer.data.contact as Record<string, unknown>).email as string 25 24 : null; 26 25 27 - if (listResult.data.cursor) { 28 - console.warn('[listRepos] response truncated at 1000 — cursor present, some accounts not shown'); 26 + const allRepos: typeof firstPage.data.repos = []; 27 + let cursor: string | undefined; 28 + 29 + const firstPage = await publicRpc.get('com.atproto.sync.listRepos', { 30 + params: { limit: LIMIT }, 31 + }); 32 + allRepos.push(...firstPage.data.repos); 33 + cursor = firstPage.data.repos.length < LIMIT ? undefined : firstPage.data.cursor; 34 + 35 + while (cursor) { 36 + const page = await publicRpc.get('com.atproto.sync.listRepos', { 37 + params: { limit: LIMIT, cursor }, 38 + }); 39 + allRepos.push(...page.data.repos); 40 + cursor = page.data.repos.length < LIMIT ? undefined : page.data.cursor; 29 41 } 30 42 31 - const active = listResult.data.repos.filter((r) => r.active !== false); 43 + const active = allRepos.filter( 44 + (r) => r.status !== 'deactivated' && r.status !== 'takendown' 45 + ); 32 46 33 47 const results = await Promise.allSettled( 34 48 active.map(async (repo) => {