fix: return orignal if size not available
Some checks are pending
Deploy / deploy (push) Waiting to run
Some checks are pending
Deploy / deploy (push) Waiting to run
This commit is contained in:
parent
ed273454a3
commit
f3dc368500
1 changed files with 8 additions and 0 deletions
|
|
@ -52,6 +52,14 @@ export const getPhoto = (size: Size, data: OptionalMedia): StaticImageData | und
|
||||||
const sizeData = data.sizes[size]
|
const sizeData = data.sizes[size]
|
||||||
|
|
||||||
if (!sizeData) {
|
if (!sizeData) {
|
||||||
|
// return original
|
||||||
|
if (data.url && data.width && data.height)
|
||||||
|
return {
|
||||||
|
src: data.url,
|
||||||
|
width: data.width,
|
||||||
|
height: data.height
|
||||||
|
};
|
||||||
|
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue