feat: implement real-time updates for showcase ratings and comments

- Add automatic cache invalidation in useNostrPublish hook
- Implement optimistic updates for comments with error recovery
- Add instant visual feedback for ratings with rollback on error
- Enhance moderation actions with immediate UI updates
- Reduce stale times and refetch intervals for faster updates
- Add loading states and visual indicators during submissions
- Create comprehensive error handling with graceful degradation
- Add RealTimeDemo component for testing real-time features
- Update background polling for better real-time synchronization

Users no longer need to refresh pages to see their updates.
All actions (comments, ratings, moderation) now feel instant
while maintaining data consistency and error recovery.
This commit is contained in:
Mary Kate Fain committed 2025-11-14 10:50:04 -06:00
1 parent 6f2ccb0b5a
commit e709dca735
9 files changed
+552 -24

No files matched your search

+2 -2
View File
@@ -223,8 +223,8 @@ export function useAppSubmissions() {
return submissions;
},
staleTime: 30000, // 30 seconds
refetchInterval: 60000, // 1 minute
staleTime: 10000, // 10 seconds
refetchInterval: 30000, // 30 seconds
});
}