Instant Feed Update on Mute or Moderation Action (#8463)

* Implemented #2406: Instant Feed Update on Mute or Moderation Action
Posts from muted or blocked users are now removed immediately from
the feed. This is achieved by extending the usePostShadow hook to
check if the post author is muted or blocked and return
POST_TOMBSTONE accordingly.
A unit test was also added to validate the new logic.

Co-authored-by: Pedro Macedo <pedrosantosmacedo@tecnico.ulisboa.pt>

* remove useless tests

---------

Co-authored-by: Pedro Macedo <pedrosantosmacedo@tecnico.ulisboa.pt>
Co-authored-by: Samuel Newman <mozzius@protonmail.com>
This commit is contained in:
Francisco Nascimento
2025-06-11 14:21:31 +01:00
committed by GitHub
parent 1380c5ac67
commit 269105371b
2 changed files with 13 additions and 3 deletions
+3 -1
View File
@@ -499,9 +499,10 @@ function useProfileBlockMutation() {
{subject: did, createdAt: new Date().toISOString()},
)
},
onSuccess(_, {did}) {
onSuccess(data, {did}) {
queryClient.invalidateQueries({queryKey: RQKEY_MY_BLOCKED()})
resetProfilePostsQueries(queryClient, did, 1000)
updateProfileShadow(queryClient, did, {blockingUri: data.uri})
},
})
}
@@ -523,6 +524,7 @@ function useProfileUnblockMutation() {
},
onSuccess(_, {did}) {
resetProfilePostsQueries(queryClient, did, 1000)
updateProfileShadow(queryClient, did, {blockingUri: undefined})
},
})
}