Rework how recently-created posts are added to the feed (repeat posts issue) (#527)

* Rework new-post behavior to just add the user's created post to the top

* Only add post to top when not a reply

* Fix: run update in action
This commit is contained in:
Paul Frazee 2023-04-24 19:41:16 -05:00 committed by GitHub
parent df1791bde2
commit 7a10762716
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 26 deletions

View file

@ -138,8 +138,9 @@ export const ComposePost = observer(function ComposePost({
setIsProcessing(true)
let createdPost
try {
await apilib.post(store, {
createdPost = await apilib.post(store, {
rawText: rt.text,
replyTo: replyTo?.uri,
images: gallery.images,
@ -163,7 +164,9 @@ export const ComposePost = observer(function ComposePost({
setIsProcessing(false)
return
}
store.me.mainFeed.checkForLatest({autoPrepend: true})
if (!replyTo) {
store.me.mainFeed.addPostToTop(createdPost.uri)
}
onPost?.()
hackfixOnClose()
Toast.show(`Your ${replyTo ? 'reply' : 'post'} has been published`)