diff options
author | Samuel Newman <mozzius@protonmail.com> | 2024-08-21 21:26:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-21 15:26:25 -0500 |
commit | 56ab5e177fa2b24d0e5d9d969aa37532b96128da (patch) | |
tree | 2fa3db0ef9e46474aac00d5a593c5e5d592da9e3 /src/view/com/composer/Composer.tsx | |
parent | ddb0b80017c2b5bc158b8ff9da222abd5a8bf025 (diff) | |
download | voidsky-56ab5e177fa2b24d0e5d9d969aa37532b96128da.tar.zst |
Show quote posts (#4865)
* show quote posts * fix filter * fix keyExtractor * move likedby and repostedby to new file structure * use modern list component * remove relative imports * update quotes count after quoting * call `onPost` after updating quote count * Revert "update quotes count after quoting" This reverts commit 1f1887730a210c57c1e5a0eb0f47c42c42cf1b4b. * implement * update like count in quotes list * only add `onPostReply` where needed * Filter quotes with detached embeds * Bump SDK * Don't show error for no results --------- Co-authored-by: Samuel Newman <10959775+mozzius@users.noreply.github.com> Co-authored-by: Hailey <me@haileyok.com> Co-authored-by: Eric Bailey <git@esb.lol>
Diffstat (limited to 'src/view/com/composer/Composer.tsx')
-rw-r--r-- | src/view/com/composer/Composer.tsx | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/view/com/composer/Composer.tsx b/src/view/com/composer/Composer.tsx index dba37d82b..0efbe70e6 100644 --- a/src/view/com/composer/Composer.tsx +++ b/src/view/com/composer/Composer.tsx @@ -116,6 +116,7 @@ export const ComposePost = observer(function ComposePost({ replyTo, onPost, quote: initQuote, + quoteCount, mention: initMention, openPicker, text: initText, @@ -392,7 +393,22 @@ export const ComposePost = observer(function ComposePost({ emitPostCreated() } setLangPrefs.savePostLanguageToHistory() - onPost?.(postUri) + if (quote) { + // We want to wait for the quote count to update before we call `onPost`, which will refetch data + whenAppViewReady(agent, quote.uri, res => { + const thread = res.data.thread + if ( + AppBskyFeedDefs.isThreadViewPost(thread) && + thread.post.quoteCount !== quoteCount + ) { + onPost?.(postUri) + return true + } + return false + }) + } else { + onPost?.(postUri) + } onClose() Toast.show( replyTo |