diff options
author | Brandon Millman <brandon.millman@gmail.com> | 2018-06-22 07:53:57 +0800 |
---|---|---|
committer | Brandon Millman <brandon.millman@gmail.com> | 2018-06-22 09:06:34 +0800 |
commit | a07cfb7abc3649f29ab5020ff5d2bea37c26cefd (patch) | |
tree | a023afb7b0af3fc5dad7c49315e5c67b3f0d9570 /packages/website | |
parent | 7c0fdc7ecf170e17aa27cb88a2b62a02ea49ca41 (diff) | |
download | dexon-sol-tools-a07cfb7abc3649f29ab5020ff5d2bea37c26cefd.tar dexon-sol-tools-a07cfb7abc3649f29ab5020ff5d2bea37c26cefd.tar.gz dexon-sol-tools-a07cfb7abc3649f29ab5020ff5d2bea37c26cefd.tar.bz2 dexon-sol-tools-a07cfb7abc3649f29ab5020ff5d2bea37c26cefd.tar.lz dexon-sol-tools-a07cfb7abc3649f29ab5020ff5d2bea37c26cefd.tar.xz dexon-sol-tools-a07cfb7abc3649f29ab5020ff5d2bea37c26cefd.tar.zst dexon-sol-tools-a07cfb7abc3649f29ab5020ff5d2bea37c26cefd.zip |
Do not add empty token to local storage
Diffstat (limited to 'packages/website')
-rw-r--r-- | packages/website/ts/components/generate_order/asset_picker.tsx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/packages/website/ts/components/generate_order/asset_picker.tsx b/packages/website/ts/components/generate_order/asset_picker.tsx index b43ac1f2e..738692264 100644 --- a/packages/website/ts/components/generate_order/asset_picker.tsx +++ b/packages/website/ts/components/generate_order/asset_picker.tsx @@ -246,6 +246,14 @@ export class AssetPicker extends React.Component<AssetPickerProps, AssetPickerSt }); const tokenAddress = this.state.chosenTrackTokenAddress; const token = this.props.tokenByAddress[tokenAddress]; + if (_.isUndefined(tokenAddress)) { + this.setState({ + isAddingTokenToTracked: false, + assetView: AssetViews.ASSET_PICKER, + chosenTrackTokenAddress: undefined, + }); + return; + } const newTokenEntry = { ...token, }; |