Preserve the protocol in Author Image

Closes #2942
This commit is contained in:
Bogdan
2023-10-01 17:27:38 +03:00
parent eae06695e8
commit e28becdda4
3 changed files with 11 additions and 6 deletions
+3 -6
View File
@@ -7,13 +7,10 @@ function findImage(images, coverType) {
}
function getUrl(image, coverType, size) {
if (image) {
// Remove protocol
let url = image.url;
const imageUrl = image?.url;
url = url.replace(`${coverType}.jpg`, `${coverType}-${size}.jpg`);
return url;
if (imageUrl) {
return imageUrl.replace(`${coverType}.jpg`, `${coverType}-${size}.jpg`);
}
}