From 3934c6d5670a0b927674745752f3c6bbd9d2d7cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Drwi=C4=99ga?= Date: Tue, 14 Sep 2021 14:04:44 +0200 Subject: [PATCH] Add local image and don't crash when logo is missing. (#284) --- src/assets/chainsLogos/local.png | Bin 0 -> 8553 bytes src/util/getConfigs.ts | 8 +++++++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 src/assets/chainsLogos/local.png diff --git a/src/assets/chainsLogos/local.png b/src/assets/chainsLogos/local.png new file mode 100644 index 0000000000000000000000000000000000000000..f901afdc35daf2246459f1a2a8e5d1593d67dcaf GIT binary patch literal 8553 zcmeHthg(xY)9*Dc&LFwT$HAVx2HI=9nJ;`lWk3io!d;s#w1vvA?xl-?6H=s%nyhPMvRcijdv>|Q2s(kQHn zr3`F7S+q-VOT1UASjB*((f@g{BxP;ui6{wq8pS@3C-r7`)#UH$6Hm4CMC4aD3F2Nm zOTq<9EvR<(v}g{oyqZiItd4;(WErfh^ZE#KY|1|i>hqRJth7zPzGdLXRkS{szl&D% zS=Y0PDMG*lVb9nAftMicuYN)G^lcp`vY&n~bj1iH!>N!xJ8km&Rm19Mhb2yZ7^3P*5j8WrB&oE?Lp`q-L;CGXNDdcJzgJ6J88cG``9 zG|z{T*wC=2R_ys3DB;AEe*Hhg_*~Po2Bbwi!!Kv&8aS7F1XAlB;)0Lz5<7ZKAh7nP z#2SFtl{)+9$NB^d-c?`#zjRi8dmmwoP0@v*nhDOvSA-)okk$7{8r#=ZT80l=NWj;$MInja(88a? z+PLBe+{!6h9^g8MF!e-L>dFi%*^SR89>P=JJ|1)G>6WJNLEu*M4Wo=YhAM~>z;#pb zgVM>xjY}NJ>sV4dub4OYi2f*hO~$2RXS4E6(Z?$ao&O=Z&BmoZZJ@tqvG_F^D)e@^ zW3Sd=#-VHXZY`=FTnGQ(u!++^&X2( z_KX8JX>;^1AZSS;<(_Q+ly=+c*z`W>Am-S28Azi~GOPNIt5wQ&E>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HHR^wx|6kf6`$l;aenpG6HsJKQ4Ie_1!B)A>G+5-5LGbcb%JlcA zKi`*8aLyAmj%-fZ#c&AH*B$WWsqL(#)v%3i?@oMPjyPCXbFt{m&63WaTg(ofk~Np{ z_r#IU4o*FReugYGDpW0}>Ym|`mNDc;mBNIe!Ll)@tDYxwl1Mw=*RNXKhZI7-T3|jW zsBpv=f#qLWY%uzH{b5M+_HH*qbdNkgXkkY3k39eO*I;K&15tpjcX0`Cc$V)TkD%aj5|_m|8~KrlwzTl5)NmD=kTG;G5DNn=M^9 zmasrRz+4DUnr%qnvB_Y&I=^W_vCX~oJA=b3=rh%EPXI=5<9Ba}{~kHBbu;Ahre-`{ z#N4f=JPdMUvPMe9yh969(7E5#7m=Jf*USCV4$aHg1LlJ3z7YogxB1^~2M7NL&#}EA zDd&YyzJFS=-j*N9Dm=tJqZ@s#N*;uHIs15ZUm3s-WeF4ZV`KR3JsWp(sJRY2oEiqF zwO#~L(j5Q{+KTi => { const { ss58Format } = properties!; const systemChain = await apiPromise.rpc.system.chain(); const chainName = systemChain.split(' ')[0]; - const logoUrl = require(`../assets/chainsLogos/${chainName.toLowerCase()}.png`).default; + + let logoUrl; + try { + logoUrl = require(`../assets/chainsLogos/${chainName.toLowerCase()}.png`).default; + } catch (e) { + logoUrl = require('../assets/chainsLogos/local.png').default; + } return { chainName, ss58Format: parseInt(ss58Format.toString()), logoUrl }; };