mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-20 15:51:12 -05:00
Refactor: Use user ref in moderation queue
This commit is contained in:
@@ -757,7 +757,7 @@ export const ModerationQueue = forwardRef<ModerationQueueRef>((props, ref) => {
|
||||
|
||||
// Initial fetch on mount and filter changes
|
||||
useEffect(() => {
|
||||
if (!user) return;
|
||||
if (!userRef.current) return;
|
||||
|
||||
// Phase 1: Initial fetch (run once)
|
||||
if (!hasInitialFetchRef.current) {
|
||||
@@ -780,8 +780,8 @@ export const ModerationQueue = forwardRef<ModerationQueueRef>((props, ref) => {
|
||||
debouncedFetchItems(debouncedEntityFilter, debouncedStatusFilter, true, activeTabRef.current);
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [debouncedEntityFilter, debouncedStatusFilter, user]);
|
||||
// Note: fetchItems and debouncedFetchItems are stable callbacks and should NOT trigger this effect
|
||||
}, [debouncedEntityFilter, debouncedStatusFilter]);
|
||||
// Note: user object reference changes shouldn't trigger filter refetch - using stable userRef instead
|
||||
|
||||
// Polling for auto-refresh (only if realtime is disabled)
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user