Skip to content

Commit

Permalink
change variable name in LinkView
Browse files Browse the repository at this point in the history
  • Loading branch information
cekk committed Oct 16, 2024
1 parent f191361 commit be78bf6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/customizations/volto/components/theme/View/LinkView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ 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));
} else if (!__SERVER__) {
window.location.href = flattenToAppURL(remoteUrl);
}
}
}, [content, history, token, isReader]);
}, [content, history, token, userWithoutRoles]);
const { title, description, remoteUrl } = content;
const { openExternalLinkInNewTab } = config.settings;
const Container =
Expand Down

0 comments on commit be78bf6

Please sign in to comment.