Fix unstable callbacks in moderation queue

This commit is contained in:
gpt-engineer-app[bot]
2025-11-05 05:00:23 +00:00
parent fcf5b9dba3
commit 540bd1cd7a
2 changed files with 17 additions and 8 deletions

View File

@@ -135,8 +135,10 @@ export const ModerationQueue = forwardRef<ModerationQueueRef, ModerationQueuePro
}, [queueManager, toast]);
// Fetch active locks count for superusers
const isSuperuserValue = isSuperuser();
useEffect(() => {
if (!isSuperuser()) return;
if (!isSuperuserValue) return;
const fetchActiveLocksCount = async () => {
const { count } = await supabase
@@ -153,7 +155,7 @@ export const ModerationQueue = forwardRef<ModerationQueueRef, ModerationQueuePro
// Refresh count periodically
const interval = setInterval(fetchActiveLocksCount, 30000); // Every 30s
return () => clearInterval(interval);
}, [isSuperuser]);
}, [isSuperuserValue]);
// Track if lock was restored from database
useEffect(() => {