Skip to content

Commit 9bb5f0b

Browse files
committed
fix: remove from local storage
1 parent 4d7f4a2 commit 9bb5f0b

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

src/containers/Tenant/Query/QueryEditor/QueryEditor.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import {
3131
DEFAULT_IS_QUERY_RESULT_COLLAPSED,
3232
DEFAULT_SIZE_RESULT_PANE_KEY,
3333
LAST_USED_QUERY_ACTION_KEY,
34-
LAST_USED_QUERY_TEXT,
3534
} from '../../../../utils/constants';
3635
import {
3736
useEventHandler,
@@ -104,8 +103,7 @@ export default function QueryEditor(props: QueryEditorProps) {
104103
const [lastUsedQueryAction, setLastUsedQueryAction] = useSetting<QueryAction>(
105104
LAST_USED_QUERY_ACTION_KEY,
106105
);
107-
108-
const [lastUsedQueryText, setLastUsedQueryText] = useSetting<string>(LAST_USED_QUERY_TEXT);
106+
const [lastExecutedQueryText, setLastExecutedQueryText] = React.useState<string>('');
109107

110108
const [sendQuery] = queryApi.useUseSendQueryMutation();
111109

@@ -143,7 +141,7 @@ export default function QueryEditor(props: QueryEditorProps) {
143141
const query = text ?? input;
144142

145143
setLastUsedQueryAction(QUERY_ACTIONS.execute);
146-
setLastUsedQueryText(query);
144+
setLastExecutedQueryText(query);
147145
if (!isEqual(lastQueryExecutionSettings, querySettings)) {
148146
resetBanner();
149147
setLastQueryExecutionSettings(querySettings);
@@ -176,7 +174,7 @@ export default function QueryEditor(props: QueryEditorProps) {
176174

177175
const handleGetExplainQueryClick = useEventHandler(() => {
178176
setLastUsedQueryAction(QUERY_ACTIONS.explain);
179-
setLastUsedQueryText(input);
177+
setLastExecutedQueryText(input);
180178
if (!isEqual(lastQueryExecutionSettings, querySettings)) {
181179
resetBanner();
182180
setLastQueryExecutionSettings(querySettings);
@@ -372,7 +370,7 @@ export default function QueryEditor(props: QueryEditorProps) {
372370
tenantName={tenantName}
373371
path={path}
374372
showPreview={showPreview}
375-
queryText={lastUsedQueryText}
373+
queryText={lastExecutedQueryText}
376374
/>
377375
</div>
378376
</SplitPane>

src/services/settings.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {
1212
LANGUAGE_KEY,
1313
LAST_QUERY_EXECUTION_SETTINGS_KEY,
1414
LAST_USED_QUERY_ACTION_KEY,
15-
LAST_USED_QUERY_TEXT,
1615
PARTITIONS_HIDDEN_COLUMNS_KEY,
1716
QUERY_EXECUTION_SETTINGS_KEY,
1817
QUERY_SETTINGS_BANNER_LAST_CLOSED_KEY,
@@ -37,7 +36,6 @@ export const DEFAULT_USER_SETTINGS = {
3736
[SAVED_QUERIES_KEY]: [],
3837
[TENANT_INITIAL_PAGE_KEY]: TENANT_PAGES_IDS.query,
3938
[LAST_USED_QUERY_ACTION_KEY]: QUERY_ACTIONS.execute,
40-
[LAST_USED_QUERY_TEXT]: '',
4139
[ASIDE_HEADER_COMPACT_KEY]: true,
4240
[PARTITIONS_HIDDEN_COLUMNS_KEY]: [],
4341
[ENABLE_NETWORK_TABLE_KEY]: false,

src/utils/constants.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ export const LAST_QUERY_EXECUTION_SETTINGS_KEY = 'last_query_execution_settings'
102102
export const QUERY_SETTINGS_BANNER_LAST_CLOSED_KEY = 'querySettingsBannerLastClosed';
103103

104104
export const LAST_USED_QUERY_ACTION_KEY = 'last_used_query_action';
105-
export const LAST_USED_QUERY_TEXT = 'last_used_query_text';
106105

107106
export const PARTITIONS_HIDDEN_COLUMNS_KEY = 'partitionsHiddenColumns';
108107

0 commit comments

Comments
 (0)