Skip to content

Commit

Permalink
[Logs Explorer] Fix namespace filter sync problem (#193307)
Browse files Browse the repository at this point in the history
closes #193304
  • Loading branch information
mohamedhamed-ahmed authored Sep 19, 2024
1 parent 09374ad commit 1c39fa2
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import type { DataView } from '@kbn/data-views-plugin/public';
import { DiscoverStateContainer } from '@kbn/discover-plugin/public';
import deepEqual from 'fast-deep-equal';
import { mapValues, pick } from 'lodash';
import { InvokeCreator } from 'xstate';
import {
Expand Down Expand Up @@ -39,8 +40,17 @@ export const subscribeControlGroup =
discoverStateContainer.actions.fetchData();
});

const inputSubscription = context.controlGroupAPI
.getInput$()
.subscribe(({ initialChildControlState: panels }) => {
if (!deepEqual(panels, context.controlPanels)) {
send({ type: 'UPDATE_CONTROL_PANELS', controlPanels: panels });
}
});

return () => {
filtersSubscription.unsubscribe();
inputSubscription.unsubscribe();
};
};

Expand Down

0 comments on commit 1c39fa2

Please sign in to comment.