fix(#2): state checking

This commit is contained in:
2026-03-10 16:41:26 +01:00
parent 0ffd1e52ae
commit 3fb0f7166b
4 changed files with 14 additions and 7 deletions

View File

@@ -10,6 +10,7 @@ import LoadingSpinner from './LoadingSpinner';
import PomodoroTimer from './PomodoroTimer';
import RefreshBanner from './RefreshBanner';
import UserSelectModal from './UserSelectModal';
import { DATA_FRESHNESS_INTERVAL } from '@/lib/constants';
function ClientWrapperContent({ children }: { children: ReactNode }) {
const [pomo] = useAtom(pomodoroAtom)
@@ -52,9 +53,7 @@ function ClientWrapperContent({ children }: { children: ReactNode }) {
useEffect(() => {
// Interval for polling data freshness
if (clientToken && !showRefreshBanner && status === 'authenticated') {
const intervalId = setInterval(() => {
performFreshnessCheck();
}, 30000); // Check every 30 seconds
const intervalId = setInterval(performFreshnessCheck, DATA_FRESHNESS_INTERVAL);
return () => clearInterval(intervalId);
}