diff --git a/app/vmui/packages/vmui/src/components/Home/Configurator/useFetchQuery.ts b/app/vmui/packages/vmui/src/components/Home/Configurator/useFetchQuery.ts index 72e7e64b8..09c1913c3 100644 --- a/app/vmui/packages/vmui/src/components/Home/Configurator/useFetchQuery.ts +++ b/app/vmui/packages/vmui/src/components/Home/Configurator/useFetchQuery.ts @@ -2,7 +2,6 @@ import {useEffect, useMemo, useState} from "react"; import {getQueryRangeUrl, getQueryUrl} from "../../../api/query-range"; import {useAppState} from "../../../state/common/StateContext"; import {InstantMetricResult, MetricResult} from "../../../api/types"; -import {saveToStorage} from "../../../utils/storage"; import {isValidHttpUrl} from "../../../utils/url"; import {useAuthState} from "../../../state/auth/AuthStateContext"; import {TimeParams} from "../../../types"; @@ -56,7 +55,6 @@ export const useFetchQuery = (): { try { const response = await fetch(fetchUrl, { headers }); if (response.ok) { - saveToStorage("LAST_QUERY", query); const resp = await response.json(); setError(undefined); displayType === "chart" ? setGraphData(resp.data.result) : setLiveData(resp.data.result); diff --git a/app/vmui/packages/vmui/src/state/common/reducer.ts b/app/vmui/packages/vmui/src/state/common/reducer.ts index 3b409b78e..a0b3ac250 100644 --- a/app/vmui/packages/vmui/src/state/common/reducer.ts +++ b/app/vmui/packages/vmui/src/state/common/reducer.ts @@ -46,7 +46,7 @@ export type Action = const duration = getQueryStringValue("g0.range_input", "1h") as string; const endInput = formatDateToLocal(getQueryStringValue("g0.end_input", getDateNowUTC()) as Date); -const query = getQueryStringValue("g0.expr", getFromStorage("LAST_QUERY") as string || "\n") as string; +const query = getQueryStringValue("g0.expr", "") as string; export const initialState: AppState = { serverUrl: getDefaultServer(), diff --git a/app/vmui/packages/vmui/src/utils/storage.ts b/app/vmui/packages/vmui/src/utils/storage.ts index 6346f25e1..2a79c5999 100644 --- a/app/vmui/packages/vmui/src/utils/storage.ts +++ b/app/vmui/packages/vmui/src/utils/storage.ts @@ -1,5 +1,4 @@ -export type StorageKeys = "LAST_QUERY" - | "BASIC_AUTH_DATA" +export type StorageKeys = "BASIC_AUTH_DATA" | "BEARER_AUTH_DATA" | "AUTH_TYPE" | "AUTOCOMPLETE"