From a88fa8910d8da21748f6bf9fc43b07e802a36662 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 97a4dc2283d65..49bf783ba3444 100644 --- a/superset-frontend/src/dashboard/containers/DashboardPage.tsx +++ b/superset-frontend/src/dashboard/containers/DashboardPage.tsx @@ -231,7 +231,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);