From fa9c020047d4662b2404bea1c2299aed6d2ad127 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Wed, 23 Oct 2024 12:35:04 -0500 Subject: [PATCH] Prepop --- src/state/queries/feed.ts | 4 ++++ src/view/com/composer/Composer.tsx | 16 +++++++++++----- src/view/screens/ProfileFeed.tsx | 23 ++++++++++++++++++++++- src/view/shell/Composer.web.tsx | 1 + 4 files changed, 38 insertions(+), 6 deletions(-) diff --git a/src/state/queries/feed.ts b/src/state/queries/feed.ts index 8177e8f212..7fd4278c11 100644 --- a/src/state/queries/feed.ts +++ b/src/state/queries/feed.ts @@ -46,6 +46,7 @@ export type FeedSourceFeedInfo = { name: string params: Record } + did: string cid: string avatar: string | undefined displayName: string @@ -65,6 +66,7 @@ export type FeedSourceListInfo = { name: string params: Record } + did: unknown cid: string avatar: string | undefined displayName: string @@ -99,6 +101,7 @@ export function hydrateFeedGenerator( type: 'feed', uri: view.uri, feedDescriptor: `feedgen|${view.uri}`, + did: view.did, cid: view.cid, route: { href, @@ -136,6 +139,7 @@ export function hydrateList(view: AppBskyGraphDefs.ListView): FeedSourceInfo { name: route[0], params: route[1], }, + did: view.did, cid: view.cid, avatar: view.avatar, description: new RichText({ diff --git a/src/view/com/composer/Composer.tsx b/src/view/com/composer/Composer.tsx index 39a2714030..3bf59b8a2b 100644 --- a/src/view/com/composer/Composer.tsx +++ b/src/view/com/composer/Composer.tsx @@ -141,8 +141,10 @@ export const ComposePost = ({ imageUris: initImageUris, videoUri: initVideoUri, cancelRef, + initFeeds, }: Props & { cancelRef?: React.RefObject + initFeeds?: string[] }) => { const {currentAccount} = useSession() const agent = useAgent() @@ -175,7 +177,7 @@ export const ComposePost = ({ initText, initMention, initOutlineTags: [], - initFeeds: [], + initFeeds: initFeeds || [], }, createComposerState, ) @@ -537,6 +539,7 @@ export const ComposePost = ({ const [showOutlineTags, setShowOutlineTags] = useState(false) const outlineTagsVisible = showOutlineTags || draft.tags.length > 0 const [showFeeds, setShowFeeds] = useState(false) + const feedsAreVisible = showFeeds || draft.feeds.length > 0 const { scrollHandler, @@ -793,7 +796,7 @@ export const ComposePost = ({ )} - {showFeeds && ( + {feedsAreVisible && ( @@ -806,7 +809,10 @@ export const ComposePost = ({ - + @@ -863,9 +869,9 @@ export const ComposePost = ({ )} - {!showFeeds && ( + {!feedsAreVisible && (