Do not add empty token to local storage

This commit is contained in:
Brandon Millman 2018-06-21 16:53:57 -07:00
parent 7c0fdc7ecf
commit a07cfb7abc

View File

@ -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,
};