Skip to content

Commit

Permalink
Assign found link values from find return value
Browse files Browse the repository at this point in the history
  • Loading branch information
dgcohen committed Oct 11, 2023
1 parent 6bc4669 commit fce63ff
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/models/DRBResult.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ export default class DRBResult {
// Populate selected link with first item on the selected edition that includes
// a link with a media type included in the readOnlineMediaTypes array.
let selectedLink: EditionLink
this.selectedEdition.items.find((item) =>
item.links.find((link) => {
selectedLink = link
return readOnlineMediaTypes.indexOf(link.mediaType) > -1
})
this.selectedEdition.items.find(
(item) =>
(selectedLink = item.links.find(
(link) => readOnlineMediaTypes.indexOf(link.mediaType) > -1
))
)

// Return null if no selected link is found. Otherwise, return the URL
Expand All @@ -64,11 +64,11 @@ export default class DRBResult {
// Populate download link with first item on the selected edition that includes
// a link with a media type included in the downloadMediaTypes array.
let downloadLink: EditionLink
this.selectedEdition.items.find((item) =>
item.links.find((link) => {
downloadLink = link
return downloadMediaTypes.indexOf(link.mediaType) > -1
})
this.selectedEdition.items.find(
(item) =>
(downloadLink = item.links.find(
(link) => downloadMediaTypes.indexOf(link.mediaType) > -1
))
)

const formattedDownloadLink = this.formatDownloadLink(downloadLink)
Expand Down

0 comments on commit fce63ff

Please sign in to comment.