Skip to content

Commit

Permalink
v5.0.1: fix address.toLowerCase()
Browse files Browse the repository at this point in the history
  • Loading branch information
10xSebastian committed Oct 4, 2023
1 parent 90bc439 commit 0de62a9
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions dist/esm/index.evm.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ let TokenImage = function(props){
if(storedImage && storedImage.length && storedImage != UNKNOWN_IMAGE) {
return setSource(storedImage, 'stored')
}
const foundMajorToken = Blockchains[blockchain].tokens.find((token)=> token.address.toLowerCase() === address.toLowerCase());
const foundMajorToken = Blockchains[blockchain].tokens.find((token)=> token.address.toLowerCase() === _optionalChain([address, 'optionalAccess', _ => _.toLowerCase, 'call', _2 => _2()]));
if(foundMajorToken) {
setSource(foundMajorToken.logo, 'web3-blockchains');
} else {
Expand Down Expand Up @@ -83,7 +83,7 @@ let TokenImage = function(props){
});


if(_optionalChain([metaData, 'optionalAccess', _ => _.data, 'optionalAccess', _2 => _2.uri])) {
if(_optionalChain([metaData, 'optionalAccess', _3 => _3.data, 'optionalAccess', _4 => _4.uri])) {

const uri = metaData.data.uri.replace(new RegExp('\u0000', 'g'), '');
if(uri && uri.length) {
Expand Down
4 changes: 2 additions & 2 deletions dist/esm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ let TokenImage = function(props){
if(storedImage && storedImage.length && storedImage != UNKNOWN_IMAGE) {
return setSource(storedImage, 'stored')
}
const foundMajorToken = Blockchains[blockchain].tokens.find((token)=> token.address.toLowerCase() === address.toLowerCase());
const foundMajorToken = Blockchains[blockchain].tokens.find((token)=> token.address.toLowerCase() === _optionalChain([address, 'optionalAccess', _ => _.toLowerCase, 'call', _2 => _2()]));
if(foundMajorToken) {
setSource(foundMajorToken.logo, 'web3-blockchains');
} else {
Expand Down Expand Up @@ -84,7 +84,7 @@ let TokenImage = function(props){
});


if(_optionalChain([metaData, 'optionalAccess', _ => _.data, 'optionalAccess', _2 => _2.uri])) {
if(_optionalChain([metaData, 'optionalAccess', _3 => _3.data, 'optionalAccess', _4 => _4.uri])) {

const uri = metaData.data.uri.replace(new RegExp('\u0000', 'g'), '');
if(uri && uri.length) {
Expand Down
4 changes: 2 additions & 2 deletions dist/esm/index.solana.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ let TokenImage = function(props){
if(storedImage && storedImage.length && storedImage != UNKNOWN_IMAGE) {
return setSource(storedImage, 'stored')
}
const foundMajorToken = Blockchains[blockchain].tokens.find((token)=> token.address.toLowerCase() === address.toLowerCase());
const foundMajorToken = Blockchains[blockchain].tokens.find((token)=> token.address.toLowerCase() === _optionalChain([address, 'optionalAccess', _ => _.toLowerCase, 'call', _2 => _2()]));
if(foundMajorToken) {
setSource(foundMajorToken.logo, 'web3-blockchains');
} else {
Expand Down Expand Up @@ -84,7 +84,7 @@ let TokenImage = function(props){
});


if(_optionalChain([metaData, 'optionalAccess', _ => _.data, 'optionalAccess', _2 => _2.uri])) {
if(_optionalChain([metaData, 'optionalAccess', _3 => _3.data, 'optionalAccess', _4 => _4.uri])) {

const uri = metaData.data.uri.replace(new RegExp('\u0000', 'g'), '');
if(uri && uri.length) {
Expand Down
4 changes: 2 additions & 2 deletions dist/umd/index.evm.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
if(storedImage && storedImage.length && storedImage != UNKNOWN_IMAGE) {
return setSource(storedImage, 'stored')
}
const foundMajorToken = Blockchains__default['default'][blockchain].tokens.find((token)=> token.address.toLowerCase() === address.toLowerCase());
const foundMajorToken = Blockchains__default['default'][blockchain].tokens.find((token)=> token.address.toLowerCase() === _optionalChain([address, 'optionalAccess', _ => _.toLowerCase, 'call', _2 => _2()]));
if(foundMajorToken) {
setSource(foundMajorToken.logo, 'web3-blockchains');
} else {
Expand Down Expand Up @@ -90,7 +90,7 @@
});


if(_optionalChain([metaData, 'optionalAccess', _ => _.data, 'optionalAccess', _2 => _2.uri])) {
if(_optionalChain([metaData, 'optionalAccess', _3 => _3.data, 'optionalAccess', _4 => _4.uri])) {

const uri = metaData.data.uri.replace(new RegExp('\u0000', 'g'), '');
if(uri && uri.length) {
Expand Down
4 changes: 2 additions & 2 deletions dist/umd/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
if(storedImage && storedImage.length && storedImage != UNKNOWN_IMAGE) {
return setSource(storedImage, 'stored')
}
const foundMajorToken = Blockchains__default['default'][blockchain].tokens.find((token)=> token.address.toLowerCase() === address.toLowerCase());
const foundMajorToken = Blockchains__default['default'][blockchain].tokens.find((token)=> token.address.toLowerCase() === _optionalChain([address, 'optionalAccess', _ => _.toLowerCase, 'call', _2 => _2()]));
if(foundMajorToken) {
setSource(foundMajorToken.logo, 'web3-blockchains');
} else {
Expand Down Expand Up @@ -90,7 +90,7 @@
});


if(_optionalChain([metaData, 'optionalAccess', _ => _.data, 'optionalAccess', _2 => _2.uri])) {
if(_optionalChain([metaData, 'optionalAccess', _3 => _3.data, 'optionalAccess', _4 => _4.uri])) {

const uri = metaData.data.uri.replace(new RegExp('\u0000', 'g'), '');
if(uri && uri.length) {
Expand Down
4 changes: 2 additions & 2 deletions dist/umd/index.solana.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
if(storedImage && storedImage.length && storedImage != UNKNOWN_IMAGE) {
return setSource(storedImage, 'stored')
}
const foundMajorToken = Blockchains__default['default'][blockchain].tokens.find((token)=> token.address.toLowerCase() === address.toLowerCase());
const foundMajorToken = Blockchains__default['default'][blockchain].tokens.find((token)=> token.address.toLowerCase() === _optionalChain([address, 'optionalAccess', _ => _.toLowerCase, 'call', _2 => _2()]));
if(foundMajorToken) {
setSource(foundMajorToken.logo, 'web3-blockchains');
} else {
Expand Down Expand Up @@ -90,7 +90,7 @@
});


if(_optionalChain([metaData, 'optionalAccess', _ => _.data, 'optionalAccess', _2 => _2.uri])) {
if(_optionalChain([metaData, 'optionalAccess', _3 => _3.data, 'optionalAccess', _4 => _4.uri])) {

const uri = metaData.data.uri.replace(new RegExp('\u0000', 'g'), '');
if(uri && uri.length) {
Expand Down
2 changes: 1 addition & 1 deletion package.evm.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@depay/react-token-image-evm",
"moduleName": "ReactTokenImage",
"version": "5.0.0",
"version": "5.0.1",
"description": "React component to display token images with fallbacks and unknown state.",
"main": "./dist/umd/index.evm.js",
"module": "./dist/esm/index.evm.js",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@depay/react-token-image",
"moduleName": "ReactTokenImage",
"version": "5.0.0",
"version": "5.0.1",
"description": "React component to display token images with fallbacks and unknown state.",
"main": "./dist/umd/index.js",
"module": "./dist/esm/index.js",
Expand Down
2 changes: 1 addition & 1 deletion package.solana.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@depay/react-token-image-solana",
"moduleName": "ReactTokenImage",
"version": "5.0.0",
"version": "5.0.1",
"description": "React component to display token images with fallbacks and unknown state.",
"main": "./dist/umd/index.solana.js",
"module": "./dist/esm/index.solana.js",
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ let TokenImage = function(props){
if(storedImage && storedImage.length && storedImage != UNKNOWN_IMAGE) {
return setSource(storedImage, 'stored')
}
const foundMajorToken = Blockchains[blockchain].tokens.find((token)=> token.address.toLowerCase() === address.toLowerCase())
const foundMajorToken = Blockchains[blockchain].tokens.find((token)=> token.address.toLowerCase() === address?.toLowerCase())
if(foundMajorToken) {
setSource(foundMajorToken.logo, 'web3-blockchains')
} else {
Expand Down

0 comments on commit 0de62a9

Please sign in to comment.