diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-12-05 04:23:25 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-12-05 04:23:25 +0800 |
commit | 36f22ba069968ad50df9b6f1c2fda798dd5c95bb (patch) | |
tree | 52c585e7fc5466d5f47591240d59d14f8f02d1ad /packages | |
parent | b7d804e9491349ca2ec61b812e744e1739542edd (diff) | |
download | dexon-sol-tools-36f22ba069968ad50df9b6f1c2fda798dd5c95bb.tar dexon-sol-tools-36f22ba069968ad50df9b6f1c2fda798dd5c95bb.tar.gz dexon-sol-tools-36f22ba069968ad50df9b6f1c2fda798dd5c95bb.tar.bz2 dexon-sol-tools-36f22ba069968ad50df9b6f1c2fda798dd5c95bb.tar.lz dexon-sol-tools-36f22ba069968ad50df9b6f1c2fda798dd5c95bb.tar.xz dexon-sol-tools-36f22ba069968ad50df9b6f1c2fda798dd5c95bb.tar.zst dexon-sol-tools-36f22ba069968ad50df9b6f1c2fda798dd5c95bb.zip |
fix: reset available tokens when sra endpoint is changed
Diffstat (limited to 'packages')
-rw-r--r-- | packages/website/ts/pages/instant/config_generator.tsx | 7 | ||||
-rw-r--r-- | packages/website/ts/pages/instant/config_generator_address_input.tsx | 4 |
2 files changed, 8 insertions, 3 deletions
diff --git a/packages/website/ts/pages/instant/config_generator.tsx b/packages/website/ts/pages/instant/config_generator.tsx index f2c9c698b..34c242348 100644 --- a/packages/website/ts/pages/instant/config_generator.tsx +++ b/packages/website/ts/pages/instant/config_generator.tsx @@ -48,6 +48,11 @@ export class ConfigGenerator extends React.Component<ConfigGeneratorProps, Confi public componentDidUpdate(prevProps: ConfigGeneratorProps): void { if (prevProps.value.orderSource !== this.props.value.orderSource) { this._setAvailableAssetsFromOrderProvider(); + const newConfig: ZeroExInstantBaseConfig = { + ...this.props.value, + availableAssetDatas: undefined, + }; + this.props.onConfigChange(newConfig); } } public render(): React.ReactNode { @@ -117,7 +122,7 @@ export class ConfigGenerator extends React.Component<ConfigGeneratorProps, Confi }; this.props.onConfigChange(newConfig); }; - private readonly _handleAffiliateAddressChange = (address: string) => { + private readonly _handleAffiliateAddressChange = (address: string, isValid: boolean) => { const oldConfig: ZeroExInstantBaseConfig = this.props.value; const newConfig: ZeroExInstantBaseConfig = { ...oldConfig, diff --git a/packages/website/ts/pages/instant/config_generator_address_input.tsx b/packages/website/ts/pages/instant/config_generator_address_input.tsx index c208fe52a..ccbaf4482 100644 --- a/packages/website/ts/pages/instant/config_generator_address_input.tsx +++ b/packages/website/ts/pages/instant/config_generator_address_input.tsx @@ -9,7 +9,7 @@ import { Text } from 'ts/components/ui/text'; export interface ConfigGeneratorAddressInputProps { value?: string; - onChange?: (address: string) => void; + onChange?: (address: string, isValid: boolean) => void; } export interface ConfigGeneratorAddressInputState { @@ -54,6 +54,6 @@ export class ConfigGeneratorAddressInput extends React.Component< this.setState({ errMsg, }); - this.props.onChange(address); + this.props.onChange(address, isValidAddress); }; } |