Skip to content

Commit

Permalink
[7.x] [Security Solution] Sync url state on any changes to query stri…
Browse files Browse the repository at this point in the history
…ng (#83314) (#85076)

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
kqualters-elastic and kibanamachine authored Dec 7, 2020
1 parent 28663e1 commit 25f6174
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ describe('Spy Routes', () => {
});
wrapper.update();
expect(dispatchMock.mock.calls[0]).toEqual([
{ type: 'updateSearch', search: '?updated="true"' },
]);
expect(dispatchMock.mock.calls[1]).toEqual([
{
route: {
detailName: undefined,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ export const SpyRouteComponent = memo<
search,
});
setIsInitializing(false);
} else if (search !== '' && search !== route.search) {
dispatch({
type: 'updateSearch',
search,
});
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [search]);
Expand Down

0 comments on commit 25f6174

Please sign in to comment.