mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-23 18:11:12 -05:00
feat: Implement optimistic UI updates
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -452,7 +452,7 @@ export const useModerationQueue = (config?: UseModerationQueueConfig) => {
|
||||
}, [currentLock, releaseLock]);
|
||||
|
||||
return {
|
||||
currentLock,
|
||||
currentLock, // Exposed for reactive UI updates
|
||||
queueStats,
|
||||
isLoading,
|
||||
claimNext,
|
||||
|
||||
Reference in New Issue
Block a user