aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/pages
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-12-05 04:23:25 +0800
committerFred Carlsen <fred@sjelfull.no>2018-12-06 18:58:38 +0800
commit87eaa914105e81be5452086ae7a92ec1c19ea5dd (patch)
treea3cefde77fa2e258db2c57024a9c78267f043811 /packages/website/ts/pages
parent8f5c92b1434df952e19a9ca4718e32a69d8b32ea (diff)
downloaddexon-sol-tools-87eaa914105e81be5452086ae7a92ec1c19ea5dd.tar
dexon-sol-tools-87eaa914105e81be5452086ae7a92ec1c19ea5dd.tar.gz
dexon-sol-tools-87eaa914105e81be5452086ae7a92ec1c19ea5dd.tar.bz2
dexon-sol-tools-87eaa914105e81be5452086ae7a92ec1c19ea5dd.tar.lz
dexon-sol-tools-87eaa914105e81be5452086ae7a92ec1c19ea5dd.tar.xz
dexon-sol-tools-87eaa914105e81be5452086ae7a92ec1c19ea5dd.tar.zst
dexon-sol-tools-87eaa914105e81be5452086ae7a92ec1c19ea5dd.zip
fix: reset available tokens when sra endpoint is changed
Diffstat (limited to 'packages/website/ts/pages')
-rw-r--r--packages/website/ts/pages/instant/config_generator.tsx7
-rw-r--r--packages/website/ts/pages/instant/config_generator_address_input.tsx4
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);
};
}