feat: Implement optimistic UI updates

This commit is contained in:
gpt-engineer-app[bot]
2025-10-15 14:04:49 +00:00
parent 6ca6747752
commit fd99eecfb4
3 changed files with 13 additions and 1 deletions

View File

@@ -115,6 +115,8 @@ export function useModerationQueueManager(config: ModerationQueueManagerConfig):
onLockStateChange: () => {
logger.log('🔄 Lock state changed, invalidating queue cache');
queueQuery.invalidate();
// Force immediate re-render by triggering a loading cycle
setLoadingState(prev => prev === "loading" ? "ready" : prev);
}
});
const entityCache = useEntityCache();

View File

@@ -452,7 +452,7 @@ export const useModerationQueue = (config?: UseModerationQueueConfig) => {
}, [currentLock, releaseLock]);
return {
currentLock,
currentLock, // Exposed for reactive UI updates
queueStats,
isLoading,
claimNext,