aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/components
diff options
context:
space:
mode:
authorBrandon Millman <brandon.millman@gmail.com>2018-06-22 07:53:57 +0800
committerBrandon Millman <brandon.millman@gmail.com>2018-06-22 09:06:34 +0800
commita07cfb7abc3649f29ab5020ff5d2bea37c26cefd (patch)
treea023afb7b0af3fc5dad7c49315e5c67b3f0d9570 /packages/website/ts/components
parent7c0fdc7ecf170e17aa27cb88a2b62a02ea49ca41 (diff)
downloaddexon-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/ts/components')
-rw-r--r--packages/website/ts/components/generate_order/asset_picker.tsx8
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,
};