Skip to content

Commit c2070d6

Browse files
committed
Revert "fix: issue with key"
This reverts commit 335588c.
1 parent 4f82207 commit c2070d6

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ export default function QueryEditor(props: QueryEditorProps) {
148148
database: tenantName,
149149
querySettings,
150150
enableTracingLevel,
151+
queryId,
151152
});
152153
} else {
153154
runningQueryRef.current = sendQuery({
@@ -261,7 +262,6 @@ export default function QueryEditor(props: QueryEditorProps) {
261262
onCollapseResultHandler={onCollapseResultHandler}
262263
type={type}
263264
theme={theme}
264-
key={result?.queryId}
265265
result={result}
266266
tenantName={tenantName}
267267
path={path}

src/store/reducers/query/query.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ const slice = createSlice({
7272
},
7373
updateQueryInHistory: (
7474
state,
75-
action: PayloadAction<{queryId?: string; stats: QueryStats}>,
75+
action: PayloadAction<{queryId: string; stats: QueryStats}>,
7676
) => {
7777
const {queryId, stats} = action.payload;
7878

@@ -171,7 +171,7 @@ export const {
171171

172172
interface SendQueryParams extends QueryRequestParams {
173173
actionType?: QueryAction;
174-
queryId?: string;
174+
queryId: string;
175175
querySettings?: Partial<QuerySettings>;
176176
// flag whether to send new tracing header or not
177177
// default: not send
@@ -190,10 +190,10 @@ export const queryApi = api.injectEndpoints({
190190
endpoints: (build) => ({
191191
useStreamQuery: build.mutation<null, SendQueryParams>({
192192
queryFn: async (
193-
{query, database, querySettings = {}, enableTracingLevel},
193+
{query, database, querySettings = {}, enableTracingLevel, queryId},
194194
{signal, dispatch, getState},
195195
) => {
196-
dispatch(setQueryResult({type: 'execute', isLoading: true}));
196+
dispatch(setQueryResult({type: 'execute', queryId, isLoading: true}));
197197

198198
const {action, syntax} = getActionAndSyntaxFromQueryMode(
199199
'execute',
@@ -268,6 +268,7 @@ export const queryApi = api.injectEndpoints({
268268
type: 'execute',
269269
error,
270270
isLoading: false,
271+
queryId,
271272
}),
272273
);
273274
return {error};

src/store/reducers/query/types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export interface QueryResult {
5252
type: QueryAction;
5353
data?: PreparedQueryData;
5454
error?: unknown;
55-
queryId?: string;
55+
queryId: string;
5656
isLoading: boolean;
5757
}
5858

0 commit comments

Comments
 (0)