Do not add empty token to local storage
This commit is contained in:
@@ -246,6 +246,14 @@ export class AssetPicker extends React.Component<AssetPickerProps, AssetPickerSt
|
|||||||
});
|
});
|
||||||
const tokenAddress = this.state.chosenTrackTokenAddress;
|
const tokenAddress = this.state.chosenTrackTokenAddress;
|
||||||
const token = this.props.tokenByAddress[tokenAddress];
|
const token = this.props.tokenByAddress[tokenAddress];
|
||||||
|
if (_.isUndefined(tokenAddress)) {
|
||||||
|
this.setState({
|
||||||
|
isAddingTokenToTracked: false,
|
||||||
|
assetView: AssetViews.ASSET_PICKER,
|
||||||
|
chosenTrackTokenAddress: undefined,
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
const newTokenEntry = {
|
const newTokenEntry = {
|
||||||
...token,
|
...token,
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user