diff options
author | Paul Frazee <pfrazee@gmail.com> | 2022-10-26 14:34:47 -0500 |
---|---|---|
committer | Paul Frazee <pfrazee@gmail.com> | 2022-10-26 14:34:47 -0500 |
commit | 1983512fef37c5f27a048728815ae194bb24820b (patch) | |
tree | 0674298ccf9bb067457be7f77258df2556957972 /src/view/com/post/Post.tsx | |
parent | 349cfe7177affde7e3acae2616c6c8a2fa11b1c0 (diff) | |
download | voidsky-1983512fef37c5f27a048728815ae194bb24820b.tar.zst |
Update to latest APIs
Diffstat (limited to 'src/view/com/post/Post.tsx')
-rw-r--r-- | src/view/com/post/Post.tsx | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/view/com/post/Post.tsx b/src/view/com/post/Post.tsx index 04cc5cdd6..42611a39a 100644 --- a/src/view/com/post/Post.tsx +++ b/src/view/com/post/Post.tsx @@ -1,6 +1,6 @@ import React, {useState, useEffect, useMemo} from 'react' import {observer} from 'mobx-react-lite' -import {AdxUri} from '../../../third-party/uri' +import {AtUri} from '../../../third-party/uri' import * as PostType from '../../../third-party/api/src/types/app/bsky/post' import { ActivityIndicator, @@ -59,20 +59,22 @@ export const Post = observer(function Post({uri}: {uri: string}) { const item = view.thread const record = view.thread?.record as unknown as PostType.Record - const itemUrip = new AdxUri(item.uri) - const itemHref = `/profile/${item.author.name}/post/${itemUrip.recordKey}` + const itemUrip = new AtUri(item.uri) + const itemHref = `/profile/${item.author.name}/post/${itemUrip.rkey}` const itemTitle = `Post by ${item.author.name}` const authorHref = `/profile/${item.author.name}` const authorTitle = item.author.name let replyAuthorDid = '' let replyHref = '' if (record.reply) { - const urip = new AdxUri(record.reply.parent || record.reply.root) + const urip = new AtUri(record.reply.parent?.uri || record.reply.root.uri) replyAuthorDid = urip.hostname - replyHref = `/profile/${urip.hostname}/post/${urip.recordKey}` + replyHref = `/profile/${urip.hostname}/post/${urip.rkey}` } const onPressReply = () => { - store.shell.openModal(new ComposePostModel({replyTo: item.uri})) + store.shell.openModal( + new ComposePostModel({replyTo: {uri: item.uri, cid: item.cid}}), + ) } const onPressToggleRepost = () => { item |