Commit 6322a562 authored by tom's avatar tom

tweaks

parent 54205175
......@@ -37,9 +37,9 @@ const NftMedia = ({ imageUrl, animationUrl, className }: Props) => {
const url = route({ pathname: '/api/media-type', query: { url: animationUrl } });
fetch(url)
.then((response) => response.json())
.then((_response) => {
const response = _response as { type: MediaType | undefined };
setType(response.type || 'image');
.then((_data) => {
const data = _data as { type: MediaType | undefined };
setType(data.type || 'image');
})
.catch(() => {
setType('image');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment