[Fleet] Preserve search when syncing hash router and urls (#104310)

This commit is contained in:
Nicolas Chaulet 2021-07-05 17:14:23 -04:00 committed by GitHub
parent b0b0584b55
commit e3c2dfc9b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -221,7 +221,7 @@ export const FleetAppContext: React.FC<{
const unlistenParentHistory = history.listen(() => {
const newHash = createHashHistory();
if (newHash.location.pathname !== routerHistoryInstance.location.pathname) {
routerHistoryInstance.replace(newHash.location.pathname);
routerHistoryInstance.replace(newHash.location.pathname + newHash.location.search || '');
}
});

View file

@ -196,7 +196,7 @@ export const IntegrationsAppContext: React.FC<{
const unlistenParentHistory = history.listen(() => {
const newHash = createHashHistory();
if (newHash.location.pathname !== routerHistoryInstance.location.pathname) {
routerHistoryInstance.replace(newHash.location.pathname);
routerHistoryInstance.replace(newHash.location.pathname + newHash.location.search || '');
}
});