Skip to content

Commit

Permalink
Merge pull request #250 from eea/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
avoinea authored Jul 22, 2024
2 parents 401dcfe + 8c64ac0 commit f8d19a7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

### [2.1.3](https://github.com/eea/volto-eea-website-theme/compare/2.1.2...2.1.3) - 22 July 2024

### [2.1.2](https://github.com/eea/volto-eea-website-theme/compare/2.1.1...2.1.2) - 14 June 2024

#### :house: Internal changes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eeacms/volto-eea-website-theme",
"version": "2.1.2",
"version": "2.1.3",
"description": "@eeacms/volto-eea-website-theme: Volto add-on",
"main": "src/index.js",
"author": "European Environment Agency: IDM2 A-Team",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const UniversalLink = ({
const token = useSelector((state) => state.userSession?.token);

let url = href;

if (!href && item) {
if (!item['@id']) {
// eslint-disable-next-line no-console
Expand All @@ -51,10 +52,10 @@ const UniversalLink = ({

//case: item of type 'File'
if (
!token &&
download &&
config.settings.downloadableObjects.includes(item['@type'])
) {
url = `${url}/@@download/file`;
url = url.includes('/@@download/file') ? url : `${url}/@@download/file`;
}

if (
Expand All @@ -68,10 +69,10 @@ const UniversalLink = ({

const isExternal = !isInternalURL(url);

const isDownload = (!isExternal && url.includes('@@download')) || download;
const isDownload = !isExternal && url && url.includes('@@download/file');

const isDisplayFile =
(!isExternal && url.includes('@@display-file')) || false;

const checkedURL = URLUtils.checkAndNormalizeUrl(url);

// we can receive an item with a linkWithHash property set from ObjectBrowserWidget
Expand Down

0 comments on commit f8d19a7

Please sign in to comment.