fix: reused getRkey function in embed component (#6591)
This commit is contained in:
@@ -9,7 +9,6 @@ import {
|
|||||||
AppBskyGraphDefs,
|
AppBskyGraphDefs,
|
||||||
AppBskyGraphStarterpack,
|
AppBskyGraphStarterpack,
|
||||||
AppBskyLabelerDefs,
|
AppBskyLabelerDefs,
|
||||||
AtUri,
|
|
||||||
} from '@atproto/api'
|
} from '@atproto/api'
|
||||||
import {ComponentChildren, h} from 'preact'
|
import {ComponentChildren, h} from 'preact'
|
||||||
import {useMemo} from 'preact/hooks'
|
import {useMemo} from 'preact/hooks'
|
||||||
@@ -437,14 +436,14 @@ function StarterPackEmbed({
|
|||||||
|
|
||||||
// from #/lib/strings/starter-pack.ts
|
// from #/lib/strings/starter-pack.ts
|
||||||
function getStarterPackImage(starterPack: AppBskyGraphDefs.StarterPackView) {
|
function getStarterPackImage(starterPack: AppBskyGraphDefs.StarterPackView) {
|
||||||
const rkey = new AtUri(starterPack.uri).rkey
|
const rkey = getRkey(starterPack.uri)
|
||||||
return `https://ogcard.cdn.bsky.app/start/${starterPack.creator.did}/${rkey}`
|
return `https://ogcard.cdn.bsky.app/start/${starterPack.creator.did}/${rkey}`
|
||||||
}
|
}
|
||||||
|
|
||||||
function getStarterPackHref(
|
function getStarterPackHref(
|
||||||
starterPack: AppBskyGraphDefs.StarterPackViewBasic,
|
starterPack: AppBskyGraphDefs.StarterPackViewBasic,
|
||||||
) {
|
) {
|
||||||
const rkey = new AtUri(starterPack.uri).rkey
|
const rkey = getRkey(starterPack.uri)
|
||||||
const handleOrDid = starterPack.creator.handle || starterPack.creator.did
|
const handleOrDid = starterPack.creator.handle || starterPack.creator.did
|
||||||
return `/starter-pack/${handleOrDid}/${rkey}`
|
return `/starter-pack/${handleOrDid}/${rkey}`
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user