Fix: Prevent unnecessary fetchItems on tab switch

This commit is contained in:
gpt-engineer-app[bot]
2025-10-12 19:26:20 +00:00
parent ffb0297854
commit 8d9d00ef13

View File

@@ -777,9 +777,9 @@ export const ModerationQueue = forwardRef<ModerationQueueRef>((props, ref) => {
// Phase 2: Filter changes (only after initial fetch completes)
if (!isMountingRef.current && initialFetchCompleteRef.current) {
debouncedFetchItems(debouncedEntityFilter, debouncedStatusFilter, true, activeTab);
debouncedFetchItems(debouncedEntityFilter, debouncedStatusFilter, true, activeTabRef.current);
}
}, [debouncedEntityFilter, debouncedStatusFilter, user, activeTab, fetchItems, debouncedFetchItems]);
}, [debouncedEntityFilter, debouncedStatusFilter, user, fetchItems, debouncedFetchItems]);
// Polling for auto-refresh (only if realtime is disabled)
useEffect(() => {