Skip to content

Commit

Permalink
fix: error loading scaleway template URL
Browse files Browse the repository at this point in the history
  • Loading branch information
SgtPooki committed Nov 28, 2023
1 parent 7f377ff commit ee97c58
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/constants/pinning.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,15 @@ const pinningServiceTemplates = [
visitServiceUrl: 'https://www.scaleway.com/en/docs/labs/ipfs/api-cli/ipfs-desktop/'
}
].map((service) => {
const domain = new URL(service.apiEndpoint).hostname
service.complianceReportUrl = `${complianceReportsHomepage}/${domain}.html`
return service
}).map(service => ({ service, sort: Math.random() })).sort((a, b) => a.sort - b.sort).map(({ service }) => service)
try {
const domain = new URL(service.apiEndpoint).hostname
service.complianceReportUrl = `${complianceReportsHomepage}/${domain}.html`

Check warning on line 62 in src/constants/pinning.js

View check run for this annotation

Codecov / codecov/patch

src/constants/pinning.js#L60-L62

Added lines #L60 - L62 were not covered by tests
} catch (e) {
// if apiEndpoint is not a valid URL, don't add complianceReportUrl
// TODO: fix support for template apiEndpoints
}
return { service, sort: Math.random() }
}).sort((a, b) => a.sort - b.sort).map(({ service }) => service)

Check warning on line 68 in src/constants/pinning.js

View check run for this annotation

Codecov / codecov/patch

src/constants/pinning.js#L67-L68

Added lines #L67 - L68 were not covered by tests

export {
complianceReportsHomepage,
Expand Down

0 comments on commit ee97c58

Please sign in to comment.