From c99d9f3038d5288bb5dff6b4dba9287af3221757 Mon Sep 17 00:00:00 2001 From: Smart-Codi Date: Tue, 5 Apr 2022 17:20:31 -0400 Subject: [PATCH] fix: Clean up custom css when dashboard unmounted (#19342) * clean up custom css when dashboard unmounted * resolve comment --- superset-frontend/src/dashboard/containers/DashboardPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/superset-frontend/src/dashboard/containers/DashboardPage.tsx b/superset-frontend/src/dashboard/containers/DashboardPage.tsx index c0f56322f6172..ac479fd3dde28 100644 --- a/superset-frontend/src/dashboard/containers/DashboardPage.tsx +++ b/superset-frontend/src/dashboard/containers/DashboardPage.tsx @@ -232,7 +232,7 @@ export const DashboardPage: FC = ({ idOrSlug }: PageProps) => { }, [dashboard_title]); useEffect(() => { - if (css) { + if (typeof css === 'string') { // returning will clean up custom css // when dashboard unmounts or changes return injectCustomCss(css);