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