Skip to content

Commit

Permalink
fixed the use of links with hash
Browse files Browse the repository at this point in the history
  • Loading branch information
siarhei-epam committed Dec 27, 2023
1 parent 1fc5731 commit cfbdfb1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/src/helpers/useTheme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit cfbdfb1

Please sign in to comment.