`useCommunityRealtime` was already patching the React-Query cache on community_posts UPDATE events — likesCount, dislikesCount, userLike all reached the component as props on re-render. But PostCard was seeding `localLike` / `localCount` once via useState initial values and never re-reading the props after mount, so a like from another account showed up as a notification but the heart counter stayed stale until pull-to-refresh. Added a useEffect that mirrors `post.likesCount` / `post.userLike` back into local state, guarded by `isLiking` so an in-flight optimistic update isn't clobbered by a concurrent realtime patch of the same row. Handles unlike (decrement) on the same path, plus off-screen posts which get the patched cache value on remount and feed-list cards that refresh in place without scroll.
Description
Self-hosted mirror of rebreak monorepo
Languages
TypeScript
68%
Vue
7.9%
Swift
7.7%
Shell
4.2%
JavaScript
3.1%
Other
8.9%