From ccb10166e1a881895a1d27e7996e13837528cba3 Mon Sep 17 00:00:00 2001 From: KubeSphere CI Bot <47586280+ks-ci-bot@users.noreply.github.com> Date: Thu, 7 Nov 2024 09:48:15 +0800 Subject: [PATCH] [master] fix: v3Notify show error (#4338) fix: v3Notify show error Signed-off-by: miaqiang Co-authored-by: miaqiang --- packages/core/src/components/Layouts/BaseLayout/index.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/core/src/components/Layouts/BaseLayout/index.tsx b/packages/core/src/components/Layouts/BaseLayout/index.tsx index 19648788dba..e56f1eb5850 100644 --- a/packages/core/src/components/Layouts/BaseLayout/index.tsx +++ b/packages/core/src/components/Layouts/BaseLayout/index.tsx @@ -13,6 +13,7 @@ import { StylesConstants, useGlobalStyles } from '@ks-console/shared'; import Toolbox from '../../../containers/Toolbox'; import Header from '../Header'; import { Main } from './styles'; +import v3Notify from './v3Notify'; const GlobalStyle = createGlobalStyle<{ $navbarHeight?: number; $licenseTipHeight?: number }>` :root { @@ -55,7 +56,9 @@ export default function BaseLayout() { window.history.pushState('', '', url); } }); + bus.$on('notify', v3Notify); return () => { + bus.$off('notify', v3Notify); document.removeEventListener('click', eventer); }; }, []);