fix: correctly initialize auto-refresh interval state from localStorage
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m7s

This commit is contained in:
Cauê Faleiros
2026-05-15 11:10:27 -03:00
parent 6aa9fff34c
commit 985d182743

View File

@@ -26,7 +26,10 @@ const Layout = () => {
const [ordersData, setOrdersData] = useState<OrderData[]>([]); const [ordersData, setOrdersData] = useState<OrderData[]>([]);
const [isLoading, setIsLoading] = useState(true); const [isLoading, setIsLoading] = useState(true);
const [refreshInterval, setRefreshInterval] = useState<number>(0); const [refreshInterval, setRefreshInterval] = useState<number>(() => {
const saved = localStorage.getItem('nexstar_refresh_interval');
return saved ? Number(saved) : 0;
});
const loadData = async (showLoading = false) => { const loadData = async (showLoading = false) => {
if (showLoading) setIsLoading(true); if (showLoading) setIsLoading(true);