Flip ifs
This commit is contained in:
@@ -24,16 +24,12 @@ function imageLoader({ quality, src, width }: ImageLoaderProps) {
|
|||||||
const isAbsoluteUrl = src.startsWith("https://") || src.startsWith("http://")
|
const isAbsoluteUrl = src.startsWith("https://") || src.startsWith("http://")
|
||||||
const hasQS = src.indexOf("?") !== -1
|
const hasQS = src.indexOf("?") !== -1
|
||||||
|
|
||||||
if (isAbsoluteUrl) {
|
if (!isAbsoluteUrl || isBlockedByFirewall(src)) {
|
||||||
if (isBlockedByFirewall(src)) {
|
return `${src}${hasQS ? "&" : "?"}w=${width}${quality ? "&q=" + quality : ""}`
|
||||||
return `${src}${hasQS ? "&" : "?"}w=${width}${quality ? "&q=" + quality : ""}`
|
|
||||||
} else {
|
|
||||||
return `https://image-scandic-hotels.netlify.app/.netlify/images?url=${src}&w=${width}${quality ? "&q=" + quality : ""}`
|
|
||||||
//return `https://img.scandichotels.com/.netlify/images?url=${src}&w=${width}${quality ? "&q=" + quality : ""}` //TODO: use this when Daniel fixed DNS in citrix
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return `${src}${hasQS ? "&" : "?"}w=${width}${quality ? "&q=" + quality : ""}`
|
return `https://image-scandic-hotels.netlify.app/.netlify/images?url=${src}&w=${width}${quality ? "&q=" + quality : ""}`
|
||||||
|
//return `https://img.scandichotels.com/.netlify/images?url=${src}&w=${width}${quality ? "&q=" + quality : ""}` //TODO: use this when Daniel fixed DNS in citrix
|
||||||
}
|
}
|
||||||
|
|
||||||
// Next/Image adds & instead of ? before the params
|
// Next/Image adds & instead of ? before the params
|
||||||
|
|||||||
Reference in New Issue
Block a user