Skip to content

Commit

Permalink
[Discover][Search Sessions] force pause refresh when restoring discov…
Browse files Browse the repository at this point in the history
…er state (elastic#105743)
  • Loading branch information
Dosant authored and vadimkibana committed Aug 8, 2021
1 parent 1beacc5 commit b44f363
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Expand Up @@ -202,5 +202,11 @@ describe('createSearchSessionRestorationDataProvider', () => {
expect(initialState.timeRange).toBe(relativeTime);
expect(restoreState.timeRange).toBe(absoluteTime);
});

test('restoreState has paused autoRefresh', async () => {
const { initialState, restoreState } = await searchSessionInfoProvider.getUrlGeneratorData();
expect(initialState.refreshInterval).toBe(undefined);
expect(restoreState.refreshInterval?.pause).toBe(true);
});
});
});
Expand Up @@ -392,6 +392,12 @@ function createUrlGeneratorState({
sort: appState.sort,
savedQuery: appState.savedQuery,
interval: appState.interval,
refreshInterval: shouldRestoreSearchSession
? {
pause: true, // force pause refresh interval when restoring a session
value: 0,
}
: undefined,
useHash: false,
};
}

0 comments on commit b44f363

Please sign in to comment.