From cfbdfb1c97addce0cd6394eda0568c1628bd794a Mon Sep 17 00:00:00 2001 From: Siarhei_Dzeraviannik Date: Thu, 28 Dec 2023 00:06:31 +0300 Subject: [PATCH] fixed the use of links with hash --- app/src/helpers/useTheme.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/helpers/useTheme.tsx b/app/src/helpers/useTheme.tsx index 320a4e613f..b79de1f609 100644 --- a/app/src/helpers/useTheme.tsx +++ b/app/src/helpers/useTheme.tsx @@ -14,10 +14,10 @@ export const useTheme = () => { // Apply the current theme to the body element useEffect(() => { - const { pathname, query } = uuiRouter.getCurrentLink(); + const { pathname, query, ...restParams } = uuiRouter.getCurrentLink(); const currentTheme = document.body.classList.value.match(/uui-theme-(\S+)\s*/)[0]; document.body.classList.replace(currentTheme, `uui-theme-${theme}`); - uuiRouter.redirect({ pathname: pathname, query: { ...query, theme: theme } }); + uuiRouter.redirect({ pathname: pathname, query: { ...query, theme: theme }, ...restParams }); }, [theme]); return {