Skip to content

Commit

Permalink
Merge branch 'master' into CORE-5072-license-typo
Browse files Browse the repository at this point in the history
  • Loading branch information
ekachxaidze98 committed Jan 14, 2025
2 parents 6ae9144 + 95969a1 commit 461caa9
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions templates/search/results.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,7 @@ const Results = ({ works, searchId }) =>
searchId: innerSearchId,
id: innerId,
}) => {
if (
innerFullTextLink == null &&
innerDownloadLink == null &&
innerModifiedReaderLink == null
)
return null
if (innerFullTextLink) return innerFullTextLink
if (
(innerFullTextLink && innerFullTextLink.includes('core')) ||
(innerDownloadLink && innerDownloadLink.includes('core')) ||
Expand All @@ -70,9 +65,23 @@ const Results = ({ works, searchId }) =>
)
}
if (innerDownloadLink) return innerDownloadLink
return innerFullTextLink
if (
innerFullTextLink == null &&
innerDownloadLink == null &&
innerModifiedReaderLink == null
)
return null
return null
}

const fullTextLinkResolved = renderFullTextLink({
fullTextLink,
downloadLink,
modifiedReaderLink,
searchId,
id,
})

return (
<SearchResult
id={`search-output-${id}`}
Expand All @@ -92,13 +101,7 @@ const Results = ({ works, searchId }) =>
metadataLink:
generateMetadataLink(metadataLink, searchId, id) ||
generateMetadataLink(displayLink, searchId, id),
fullTextLink: renderFullTextLink({
fullTextLink,
downloadLink,
modifiedReaderLink,
searchId,
id,
}),
fullTextLink: fullTextLinkResolved,
dataProviders: dataProviders || [],
isRecommended: memberType?.billing_type === 'sustaining',
}}
Expand Down

0 comments on commit 461caa9

Please sign in to comment.