atmo.rsvp
3
fork

Configure Feed

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

switch typeahead

Florian cef2e1f7 d0689b0e

+21 -12
+21 -12
src/lib/atproto/methods.ts
··· 272 272 const bytes = Array.from(new Uint8Array(arrayBuffer)); 273 273 274 274 const { uploadBlob: uploadBlobRemote } = await import('./server/repo.remote'); 275 - const result = await uploadBlobRemote({ bytes, mimeType: blob.type || 'application/octet-stream' }); 275 + const result = await uploadBlobRemote({ 276 + bytes, 277 + mimeType: blob.type || 'application/octet-stream' 278 + }); 276 279 277 280 if (aspectRatio) { 278 281 return { ...result, aspectRatio }; ··· 349 352 limit: number = 10, 350 353 host?: string 351 354 ): Promise<{ actors: AppBskyActorDefs.ProfileViewBasic[]; q: string }> { 352 - host ??= 'https://public.api.bsky.app'; 355 + host ??= 'https://typeahead.waow.tech'; 353 356 354 - const client = new Client({ 355 - handler: simpleFetchHandler({ service: host }) 356 - }); 357 + // const client = new Client({ 358 + // handler: simpleFetchHandler({ service: host }) 359 + // }); 357 360 358 - const response = await client.get('app.bsky.actor.searchActorsTypeahead', { 359 - params: { 360 - q, 361 - limit 362 - } 363 - }); 361 + // const response = await client.get('app.bsky.actor.searchActorsTypeahead', { 362 + // params: { 363 + // q, 364 + // limit 365 + // } 366 + // }); 367 + 368 + const response = await fetch( 369 + `${host}/xrpc/app.bsky.actor.searchActorsTypeahead?q=${encodeURIComponent(q)}&limit=${limit}`, 370 + { headers: { 'X-Client': 'atmo.rsvp' } } 371 + ); 364 372 365 373 if (!response.ok) return { actors: [], q }; 374 + const data = (await response.json()) as { actors: AppBskyActorDefs.ProfileViewBasic[] }; 366 375 367 - return { actors: response.data.actors, q }; 376 + return { actors: data.actors, q }; 368 377 } 369 378 370 379 /**