From 526b5a58a01b43b279c2e47ff0ad2b3538fbbcc5 Mon Sep 17 00:00:00 2001 From: Yongjie Zhao Date: Fri, 4 Jun 2021 14:53:31 +0800 Subject: [PATCH] fix: toggle fullscreen on the dashboard --- .../components/Header/HeaderActionsDropdown/index.jsx | 3 ++- superset-frontend/src/dashboard/util/getDashboardUrl.ts | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/superset-frontend/src/dashboard/components/Header/HeaderActionsDropdown/index.jsx b/superset-frontend/src/dashboard/components/Header/HeaderActionsDropdown/index.jsx index 06f5f35014158..e11ab205faec6 100644 --- a/superset-frontend/src/dashboard/components/Header/HeaderActionsDropdown/index.jsx +++ b/superset-frontend/src/dashboard/components/Header/HeaderActionsDropdown/index.jsx @@ -164,11 +164,12 @@ class HeaderActionsDropdown extends React.PureComponent { break; } case MENU_KEYS.TOGGLE_FULLSCREEN: { + const hasStandalone = !!getUrlParam(URL_PARAMS.standalone); const url = getDashboardUrl( window.location.pathname, getActiveFilters(), window.location.hash, - getUrlParam(URL_PARAMS.standalone), + !hasStandalone, ); window.location.replace(url); break; diff --git a/superset-frontend/src/dashboard/util/getDashboardUrl.ts b/superset-frontend/src/dashboard/util/getDashboardUrl.ts index 7eb817a0957a9..63b4d578dfe09 100644 --- a/superset-frontend/src/dashboard/util/getDashboardUrl.ts +++ b/superset-frontend/src/dashboard/util/getDashboardUrl.ts @@ -35,7 +35,10 @@ export default function getDashboardUrl( ); if (standalone) { - newSearchParams.set(URL_PARAMS.standalone.name, standalone.toString()); + newSearchParams.set( + URL_PARAMS.standalone.name, + standalone.toString(), + ); } const hashSection = hash ? `#${hash}` : '';