File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 11import { Constellation } from '#shared/utils/constellation'
22import { NPMX_SITE } from '#shared/utils/constants'
33
4+ const BLOG_BACKLINK_TTL_IN_SECONDS = 60 * 5
5+
46export interface BlogPostBlueskyLink {
57 did : string
68 rkey : string
@@ -30,10 +32,14 @@ export function useBlogPostBlueskyLink(slug: MaybeRefOrGetter<string | null | un
3032 url ,
3133 'app.bsky.feed.post' ,
3234 'embed.external.uri' ,
35+ 1 ,
36+ undefined ,
37+ true ,
3338 [ [ 'did:plc:jbeaa5kdaladzwq3r7f5xgwe' ] ] ,
39+ BLOG_BACKLINK_TTL_IN_SECONDS ,
3440 )
3541
36- const embedRecord = embedBacklinks . records [ embedBacklinks . records . length - 1 ]
42+ const embedRecord = embedBacklinks . records [ 0 ]
3743 if ( embedRecord ) {
3844 return {
3945 did : embedRecord . did ,
@@ -47,10 +53,14 @@ export function useBlogPostBlueskyLink(slug: MaybeRefOrGetter<string | null | un
4753 url ,
4854 'app.bsky.feed.post' ,
4955 'facets[].features[app.bsky.richtext.facet#link].uri' ,
56+ 1 ,
57+ undefined ,
58+ true ,
5059 [ [ 'did:plc:jbeaa5kdaladzwq3r7f5xgwe' ] ] ,
60+ BLOG_BACKLINK_TTL_IN_SECONDS ,
5161 )
5262
53- const facetRecord = facetBacklinks . records [ facetBacklinks . records . length - 1 ]
63+ const facetRecord = facetBacklinks . records [ 0 ]
5464 if ( facetRecord ) {
5565 return {
5666 did : facetRecord . did ,
Original file line number Diff line number Diff line change @@ -57,10 +57,10 @@ export class Constellation {
5757 subject : string ,
5858 collection : string ,
5959 recordPath : string ,
60- filterByDids : [ string ] [ ] = [ ] ,
6160 limit = 16 ,
6261 cursor ?: string ,
6362 reverse = false ,
63+ filterByDids : [ string ] [ ] = [ ] ,
6464 ttl : number | undefined = undefined ,
6565 ) {
6666 const source = encodeURIComponent ( `${ collection } :${ recordPath } ` )
You can’t perform that action at this time.
0 commit comments