An ATproto social media client -- with an independent Appview.

Revert "Instant Feed Update on Mute or Moderation Action" (#8482)

authored by samuel.fm and committed by

GitHub 18b4fcf8 8a5a7db1

+3 -13
+2 -10
src/state/cache/post-shadow.ts
··· 15 15 import {findAllPostsInQueryData as findAllPostsInThreadQueryData} from '#/state/queries/post-thread' 16 16 import {findAllPostsInQueryData as findAllPostsInSearchQueryData} from '#/state/queries/search-posts' 17 17 import {findAllPostsInQueryData as findAllPostsInThreadV2QueryData} from '#/state/queries/usePostThread/queryCache' 18 - import {useProfileShadow} from './profile-shadow' 19 18 import {castAsShadow, type Shadow} from './types' 20 19 export type {Shadow} from './types' 21 20 ··· 45 44 setShadow(shadows.get(post)) 46 45 } 47 46 48 - const authorShadow = useProfileShadow(post.author) 49 - const wasMuted = !!authorShadow.viewer?.muted 50 - const wasBlocked = !!authorShadow.viewer?.blocking 51 - 52 47 useEffect(() => { 53 48 function onUpdate() { 54 49 setShadow(shadows.get(post)) ··· 60 55 }, [post, setShadow]) 61 56 62 57 return useMemo(() => { 63 - if (wasMuted || wasBlocked) { 64 - return POST_TOMBSTONE 65 - } 66 58 if (shadow) { 67 59 return mergeShadow(post, shadow) 68 60 } else { 69 61 return castAsShadow(post) 70 62 } 71 - }, [post, shadow, wasMuted, wasBlocked]) 63 + }, [post, shadow]) 72 64 } 73 65 74 - export function mergeShadow( 66 + function mergeShadow( 75 67 post: AppBskyFeedDefs.PostView, 76 68 shadow: Partial<PostShadow>, 77 69 ): Shadow<AppBskyFeedDefs.PostView> | typeof POST_TOMBSTONE {
+1 -3
src/state/queries/profile.ts
··· 499 499 {subject: did, createdAt: new Date().toISOString()}, 500 500 ) 501 501 }, 502 - onSuccess(data, {did}) { 502 + onSuccess(_, {did}) { 503 503 queryClient.invalidateQueries({queryKey: RQKEY_MY_BLOCKED()}) 504 504 resetProfilePostsQueries(queryClient, did, 1000) 505 - updateProfileShadow(queryClient, did, {blockingUri: data.uri}) 506 505 }, 507 506 }) 508 507 } ··· 524 523 }, 525 524 onSuccess(_, {did}) { 526 525 resetProfilePostsQueries(queryClient, did, 1000) 527 - updateProfileShadow(queryClient, did, {blockingUri: undefined}) 528 526 }, 529 527 }) 530 528 }