mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-22 00:31:13 -05:00
Fix fetchItems stabilization
This commit is contained in:
@@ -771,7 +771,7 @@ export function useModerationQueueManager(
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!user || !initialFetchCompleteRef.current || pagination.currentPage === 1) return;
|
if (!user || !initialFetchCompleteRef.current || pagination.currentPage === 1) return;
|
||||||
|
|
||||||
fetchItems(true);
|
fetchItemsRef.current?.(true);
|
||||||
}, [pagination.currentPage, pagination.pageSize]);
|
}, [pagination.currentPage, pagination.pageSize]);
|
||||||
|
|
||||||
// Polling effect (when realtime disabled)
|
// Polling effect (when realtime disabled)
|
||||||
@@ -783,14 +783,14 @@ export function useModerationQueueManager(
|
|||||||
console.log('⚠️ Polling ENABLED - interval:', settings.pollInterval);
|
console.log('⚠️ Polling ENABLED - interval:', settings.pollInterval);
|
||||||
const interval = setInterval(() => {
|
const interval = setInterval(() => {
|
||||||
console.log('🔄 Polling refresh triggered');
|
console.log('🔄 Polling refresh triggered');
|
||||||
fetchItems(true);
|
fetchItemsRef.current?.(true);
|
||||||
}, settings.pollInterval);
|
}, settings.pollInterval);
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
clearInterval(interval);
|
clearInterval(interval);
|
||||||
console.log('🛑 Polling stopped');
|
console.log('🛑 Polling stopped');
|
||||||
};
|
};
|
||||||
}, [user, settings.refreshMode, settings.pollInterval, loadingState, settings.useRealtimeQueue, fetchItems]);
|
}, [user, settings.refreshMode, settings.pollInterval, loadingState, settings.useRealtimeQueue]);
|
||||||
|
|
||||||
// Visibility change handler
|
// Visibility change handler
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user