Commit Graph

4 Commits

Author SHA1 Message Date
imeepos 0d83020926 fix: pass initial count to hooks for correct optimistic update
- Add initialLikeCount and initialFavoriteCount parameters
- Use item.likeCount/item.favoriteCount as fallback
- Fixes issue where count resets to 0 on first click
2026-01-28 20:14:45 +08:00
imeepos 458027934a fix: add optimistic updates for like/favorite actions
- Immediately update store state on user action (no delay)
- Increment/decrement count optimistically for instant feedback
- Rollback on API error
- Use server-returned count for final accuracy
- Remove local useState, only use store for state
2026-01-28 20:12:40 +08:00
imeepos e6416ee604 fix: sync store state when like/favorite actions complete
- Update templateSocialStore when like/unlike succeeds
- Update templateSocialStore when favorite/unfavorite succeeds
- Sync likeCount and favoriteCount from API response
- Ensure state consistency across video page and detail page

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 19:23:11 +08:00
imeepos 7c50d396e9 fix: bug 2026-01-28 18:46:44 +08:00