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 30, 2023
1 parent 7f377ff commit 7a3388e
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`
} 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)

export {
complianceReportsHomepage,
Expand Down

0 comments on commit 7a3388e

Please sign in to comment.