diff options
author | Brandon Millman <brandon@0xproject.com> | 2018-10-30 01:58:11 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-30 01:58:11 +0800 |
commit | fdf9e860dedf5dbe7840951f304a33ac2d7b1b51 (patch) | |
tree | 2acfc843dce83d5f8643980f9c74af25d12a18df /packages/instant/src/util/asset.ts | |
parent | 4e4291eccdd6c837bbec70603aa6eb64d3aa8d85 (diff) | |
parent | 3f35239b27653da898218e53909982203fad6d17 (diff) | |
download | dexon-sol-tools-fdf9e860dedf5dbe7840951f304a33ac2d7b1b51.tar.gz dexon-sol-tools-fdf9e860dedf5dbe7840951f304a33ac2d7b1b51.tar.zst dexon-sol-tools-fdf9e860dedf5dbe7840951f304a33ac2d7b1b51.zip |
Merge pull request #1187 from 0xProject/feature/instant/fixed-orders-in-render-method
[instant] Add ability to toggle render settings through URL, flash error on incorrect network, provided liquidity
Diffstat (limited to 'packages/instant/src/util/asset.ts')
-rw-r--r-- | packages/instant/src/util/asset.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/packages/instant/src/util/asset.ts b/packages/instant/src/util/asset.ts index 2c5b6325d..630103c7b 100644 --- a/packages/instant/src/util/asset.ts +++ b/packages/instant/src/util/asset.ts @@ -18,7 +18,10 @@ export const assetUtils = { getMetaDataOrThrow: (assetData: string, metaDataMap: ObjectMap<AssetMetaData>, network: Network): AssetMetaData => { let mainnetAssetData: string | undefined = assetData; if (network !== Network.Mainnet) { - mainnetAssetData = assetUtils.getAssociatedAssetDataIfExists(assetData, network); + const mainnetAssetDataIfExists = assetUtils.getAssociatedAssetDataIfExists(assetData, network); + // Just so we don't fail in the case where we are on a non-mainnet network, + // but pass in a valid mainnet assetData. + mainnetAssetData = mainnetAssetDataIfExists || assetData; } if (_.isUndefined(mainnetAssetData)) { throw new Error(ZeroExInstantError.AssetMetaDataNotAvailable); |