Skip to content

Commit 36531f1

Browse files
committed
fix URL query loss on redirect
1 parent 6ec817b commit 36531f1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

x-pack/plugins/lens/public/app_plugin/mounter.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,12 @@ export async function mountApp(
9797

9898
const redirectTo = (routeProps: RouteComponentProps<{ id?: string }>, savedObjectId?: string) => {
9999
if (!savedObjectId) {
100-
routeProps.history.push('/');
100+
routeProps.history.push({ pathname: '/', search: routeProps.history.location.search });
101101
} else {
102-
routeProps.history.push(`/edit/${savedObjectId}`);
102+
routeProps.history.push({
103+
pathname: `/edit/${savedObjectId}`,
104+
search: routeProps.history.location.search,
105+
});
103106
}
104107
};
105108

0 commit comments

Comments
 (0)