Skip to content

Commit

Permalink
Clear appliedFilterQuery when stream changes
Browse files Browse the repository at this point in the history
  • Loading branch information
praveen5959 authored and praveen5959 committed Nov 7, 2024
1 parent cefd979 commit 7bb6536
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/pages/Dashboards/CreateTileForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const noDataWarning = 'No data available for the query';
const invalidVizConfig = 'Invalid visualization config';

const { toggleVizEditorModal, toggleCreateTileModal } = dashboardsStoreReducers;
const { toggleSavedFiltersModal } = filterStoreReducers;
const { toggleSavedFiltersModal, setAppliedFilterQuery } = filterStoreReducers;
const { changeStream } = appStoreReducers;

const getErrorMsg = (form: TileFormType, configType: 'basic' | 'data' | 'viz'): string | null => {
Expand Down Expand Up @@ -358,7 +358,10 @@ const Query = (props: { form: TileFormType; onChangeValue: (key: string, value:
}, [query, dashboardId, dashboards, timeRange]);

const onStreamSelect = useCallback((stream: string | null) => {
if (stream) setAppStore((store) => changeStream(store, stream));
if (stream) {
setAppStore((store) => changeStream(store, stream));
setLogsStore((store) => setAppliedFilterQuery(store, ''));
}
setLocalStream(stream || '');
}, []);

Expand Down

0 comments on commit 7bb6536

Please sign in to comment.