Handle token not having imageurl
This commit is contained in:
parent
43fbf39b89
commit
a977927a56
4
main.js
4
main.js
|
@ -277,9 +277,11 @@ const checkStatusAndUpdateOBS = async () => {
|
||||||
if (response.data.pairs && response.data.pairs.length > 0) {
|
if (response.data.pairs && response.data.pairs.length > 0) {
|
||||||
const pair = response.data.pairs[0];
|
const pair = response.data.pairs[0];
|
||||||
|
|
||||||
|
const defaultImageUrl = "https://etc.worldhistory.org/wp-content/uploads/2014/12/IMG_3573-888x1024.jpg";
|
||||||
|
|
||||||
const tokenData = {
|
const tokenData = {
|
||||||
name: pair.baseToken.name,
|
name: pair.baseToken.name,
|
||||||
imageUrl: pair.info.imageUrl,
|
imageUrl: pair.info && pair.info.imageUrl ? pair.info.imageUrl : defaultImageUrl,
|
||||||
symbol: pair.baseToken.symbol,
|
symbol: pair.baseToken.symbol,
|
||||||
marketCap: pair.fdv,
|
marketCap: pair.fdv,
|
||||||
price: pair.priceUsd,
|
price: pair.priceUsd,
|
||||||
|
|
Loading…
Reference in New Issue