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:
parent
df1791bde2
commit
7a10762716
2 changed files with 28 additions and 26 deletions
|
@ -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`)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue