From ebec353351aed9421c7db8fdeb8a7a9c05ca97ab Mon Sep 17 00:00:00 2001 From: Geido <60598000+geido@users.noreply.github.com> Date: Thu, 22 Jul 2021 21:58:43 +0200 Subject: [PATCH] fix(dashboard): Remove edit from url params when discarding changes (#15709) * Remove edit from url params * Change replace to assign --- superset-frontend/src/dashboard/components/Header/index.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/superset-frontend/src/dashboard/components/Header/index.jsx b/superset-frontend/src/dashboard/components/Header/index.jsx index b4595774fe..79411fad11 100644 --- a/superset-frontend/src/dashboard/components/Header/index.jsx +++ b/superset-frontend/src/dashboard/components/Header/index.jsx @@ -129,7 +129,10 @@ const StyledDashboardHeader = styled.div` class Header extends React.PureComponent { static discardChanges() { - window.location.reload(); + const url = new URL(window.location.href); + + url.searchParams.delete('edit'); + window.location.assign(url); } constructor(props) {