my fork of the bluesky client

fix: reused getRkey function in embed component (#6591)

authored by

Aditya Mathur and committed by
GitHub
f67e00a8 48cda135

+2 -3
+2 -3
bskyembed/src/components/embed.tsx
··· 9 AppBskyGraphDefs, 10 AppBskyGraphStarterpack, 11 AppBskyLabelerDefs, 12 - AtUri, 13 } from '@atproto/api' 14 import {ComponentChildren, h} from 'preact' 15 import {useMemo} from 'preact/hooks' ··· 437 438 // from #/lib/strings/starter-pack.ts 439 function getStarterPackImage(starterPack: AppBskyGraphDefs.StarterPackView) { 440 - const rkey = new AtUri(starterPack.uri).rkey 441 return `https://ogcard.cdn.bsky.app/start/${starterPack.creator.did}/${rkey}` 442 } 443 444 function getStarterPackHref( 445 starterPack: AppBskyGraphDefs.StarterPackViewBasic, 446 ) { 447 - const rkey = new AtUri(starterPack.uri).rkey 448 const handleOrDid = starterPack.creator.handle || starterPack.creator.did 449 return `/starter-pack/${handleOrDid}/${rkey}` 450 }
··· 9 AppBskyGraphDefs, 10 AppBskyGraphStarterpack, 11 AppBskyLabelerDefs, 12 } from '@atproto/api' 13 import {ComponentChildren, h} from 'preact' 14 import {useMemo} from 'preact/hooks' ··· 436 437 // from #/lib/strings/starter-pack.ts 438 function getStarterPackImage(starterPack: AppBskyGraphDefs.StarterPackView) { 439 + const rkey = getRkey(starterPack.uri) 440 return `https://ogcard.cdn.bsky.app/start/${starterPack.creator.did}/${rkey}` 441 } 442 443 function getStarterPackHref( 444 starterPack: AppBskyGraphDefs.StarterPackViewBasic, 445 ) { 446 + const rkey = getRkey(starterPack.uri) 447 const handleOrDid = starterPack.creator.handle || starterPack.creator.did 448 return `/starter-pack/${handleOrDid}/${rkey}` 449 }