Fix: Page State Reset in Infra
This commit is contained in:
1 parent
e2f99f52db
commit
55e9c74031
1 file changed
+7
-1
@@ -11,7 +11,7 @@ import Filter from "./Components/Filters";
|
|||||||
import SearchComponent from "../../Uptime/Monitors/Components/SearchComponent";
|
import SearchComponent from "../../Uptime/Monitors/Components/SearchComponent";
|
||||||
// Utils
|
// Utils
|
||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import { useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useIsAdmin } from "../../../Hooks/useIsAdmin";
|
import { useIsAdmin } from "../../../Hooks/useIsAdmin";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { useFetchMonitorsByTeamId } from "../../../Hooks/monitorHooks";
|
import { useFetchMonitorsByTeamId } from "../../../Hooks/monitorHooks";
|
||||||
@@ -58,6 +58,12 @@ const InfrastructureMonitors = () => {
|
|||||||
setPage(0);
|
setPage(0);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (isSearching) {
|
||||||
|
setPage(0);
|
||||||
|
}
|
||||||
|
}, [isSearching]);
|
||||||
|
|
||||||
const handleReset = () => {
|
const handleReset = () => {
|
||||||
setSelectedStatus(undefined);
|
setSelectedStatus(undefined);
|
||||||
setToFilterStatus(undefined);
|
setToFilterStatus(undefined);
|
||||||
|
|||||||
Reference in new issue
Block a user