diff options
Diffstat (limited to 'bskyembed/src/utils.ts')
-rw-r--r-- | bskyembed/src/utils.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/bskyembed/src/utils.ts b/bskyembed/src/utils.ts index 3408fcd97..1f6fd5061 100644 --- a/bskyembed/src/utils.ts +++ b/bskyembed/src/utils.ts @@ -1,3 +1,5 @@ +import {AtUri} from '@atproto/api' + export function niceDate(date: number | string | Date) { const d = new Date(date) return `${d.toLocaleDateString('en-us', { @@ -11,5 +13,6 @@ export function niceDate(date: number | string | Date) { } export function getRkey({uri}: {uri: string}): string { - return uri.split('/').pop() as string + const at = new AtUri(uri) + return at.rkey } |