From be78bf6b0e64413c83959266d8dd5ffcf7847d4b Mon Sep 17 00:00:00 2001 From: Andrea Cecchi Date: Wed, 16 Oct 2024 14:31:19 +0200 Subject: [PATCH] change variable name in LinkView --- src/customizations/volto/components/theme/View/LinkView.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/customizations/volto/components/theme/View/LinkView.jsx b/src/customizations/volto/components/theme/View/LinkView.jsx index 707a8eb5c..424fc19bd 100644 --- a/src/customizations/volto/components/theme/View/LinkView.jsx +++ b/src/customizations/volto/components/theme/View/LinkView.jsx @@ -13,12 +13,12 @@ import config from '@plone/volto/registry'; const LinkView = ({ token, content }) => { const history = useHistory(); - const isReader = useSelector((state) => + const userWithoutRoles = useSelector((state) => state.users?.user ? state.users.user?.roles?.length === 0 : true, ); useEffect(() => { - if (!token || isReader) { + if (!token || userWithoutRoles) { const { remoteUrl } = content; if (isInternalURL(remoteUrl)) { history.replace(flattenToAppURL(remoteUrl)); @@ -26,7 +26,7 @@ const LinkView = ({ token, content }) => { window.location.href = flattenToAppURL(remoteUrl); } } - }, [content, history, token, isReader]); + }, [content, history, token, userWithoutRoles]); const { title, description, remoteUrl } = content; const { openExternalLinkInNewTab } = config.settings; const Container =