Fix: Reset Page when Searching

This commit is contained in:
Br0wnHammer committed 2025-07-14 01:45:28 +05:30
1 parent c54e6b0b34
commit f912c5eb5d
1 file changed
+7 -1
+7 -1
View File
@@ -21,7 +21,7 @@ import MonitorCountHeader from "../../../Components/MonitorCountHeader";
import { Stack, Box, Button, Typography } from "@mui/material";
// Utils
import { useState, useCallback } from "react";
import { useState, useCallback, useEffect } from "react";
import { useIsAdmin } from "../../../Hooks/useIsAdmin";
import { useTheme } from "@emotion/react";
import { useNavigate } from "react-router-dom";
@@ -146,6 +146,12 @@ const UptimeMonitors = () => {
monitorUpdateTrigger,
});
useEffect(() => {
if (isSearching) {
setPage(undefined);
}
}, [isSearching]);
const isLoading = monitorsWithSummaryIsLoading || monitorsWithChecksIsLoading;
if (networkError) {
return (