Skip to content

Commit

Permalink
CB-5278 fix: don't dispose execution context (#2718)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wroud authored Jun 18, 2024
1 parent 9a471be commit cdd3a35
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* you may not use this file except in compliance with the License.
*/
import { observer } from 'mobx-react-lite';
import { useState } from 'react';

import { s, useS, useTranslate } from '@cloudbeaver/core-blocks';
import { useTabLocalState } from '@cloudbeaver/core-ui';
Expand All @@ -26,15 +25,14 @@ export const DVResultSetGroupingPresentation: DataPresentationComponent<any, IDa
}) {
const state = useTabLocalState<IDVResultSetGroupingPresentationState>(() => ({
presentationId: '',
valuePresentationId: null,
columns: [],
functions: [DEFAULT_GROUPING_QUERY_OPERATION],
showDuplicatesOnly: false,
}));
const style = useS(styles);

const translate = useTranslate();
const [presentationId, setPresentation] = useState('');
const [valuePresentationId, setValuePresentation] = useState<string | null>(null);
const model = useGroupingDataModel(originalModel, resultIndex, state);
const dnd = useGroupingDnDColumns(state, originalModel, model);

Expand Down Expand Up @@ -66,11 +64,15 @@ export const DVResultSetGroupingPresentation: DataPresentationComponent<any, IDa
<TableViewerLoader
tableId={model.model.id}
resultIndex={resultIndex}
presentationId={presentationId}
valuePresentationId={valuePresentationId}
presentationId={state.presentationId}
valuePresentationId={state.valuePresentationId}
simple
onPresentationChange={setPresentation}
onValuePresentationChange={setValuePresentation}
onPresentationChange={presentationId => {
state.presentationId = presentationId;
}}
onValuePresentationChange={presentationId => {
state.valuePresentationId = presentationId;
}}
/>
)}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ import type { IGroupingQueryState } from './IGroupingQueryState';

export interface IDVResultSetGroupingPresentationState extends IGroupingQueryState {
presentationId: string;
valuePresentationId: string | null;
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export function useGroupingDataModel(
source,
model,
dispose() {
this.model.dispose();
this.model.dispose(true);
tableViewerStorageService.remove(this.model.id);
},
};
Expand Down

0 comments on commit cdd3a35

Please sign in to comment.