mirror of
https://github.com/prometheus/prometheus.git
synced 2025-02-02 08:31:11 -08:00
Don't update pathPrefix in settings on every App render
Signed-off-by: Julius Volz <julius.volz@gmail.com>
This commit is contained in:
parent
d0ccbd2eb5
commit
f3f324be89
|
@ -52,7 +52,7 @@ import TSDBStatusPage from "./pages/TSDBStatusPage";
|
||||||
import FlagsPage from "./pages/FlagsPage";
|
import FlagsPage from "./pages/FlagsPage";
|
||||||
import ConfigPage from "./pages/ConfigPage";
|
import ConfigPage from "./pages/ConfigPage";
|
||||||
import AgentPage from "./pages/AgentPage";
|
import AgentPage from "./pages/AgentPage";
|
||||||
import { Suspense } from "react";
|
import { Suspense, useEffect } from "react";
|
||||||
import ErrorBoundary from "./components/ErrorBoundary";
|
import ErrorBoundary from "./components/ErrorBoundary";
|
||||||
import { ThemeSelector } from "./components/ThemeSelector";
|
import { ThemeSelector } from "./components/ThemeSelector";
|
||||||
import { Notifications } from "@mantine/notifications";
|
import { Notifications } from "@mantine/notifications";
|
||||||
|
@ -192,7 +192,10 @@ function App() {
|
||||||
|
|
||||||
const pathPrefix = getPathPrefix(window.location.pathname);
|
const pathPrefix = getPathPrefix(window.location.pathname);
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
dispatch(updateSettings({ pathPrefix }));
|
|
||||||
|
useEffect(() => {
|
||||||
|
dispatch(updateSettings({ pathPrefix }));
|
||||||
|
}, [pathPrefix]);
|
||||||
|
|
||||||
const { agentMode } = useSettings();
|
const { agentMode } = useSettings();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue