Skip to content

Commit

Permalink
fix: disable loading state and validating state (#1487)
Browse files Browse the repository at this point in the history
  • Loading branch information
loatheb authored Sep 6, 2022
1 parent abebc96 commit 1edc8fd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/kit/src/components/NameServiceResolver/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,9 @@ export const useNameServiceStatus = () => {
address: state?.activeAddress,
disableSubmitBtn: buildDisableStatus,
name: state?.name,
isValid: state?.isValidName,
}),
[state?.activeAddress, buildDisableStatus, state?.name],
[state?.activeAddress, buildDisableStatus, state?.name, state?.isValidName],
);
};

Expand Down
4 changes: 3 additions & 1 deletion packages/kit/src/views/Send/PreSendAddress.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ function PreSendAddress() {
const {
onChange: onNameServiceChange,
disableSubmitBtn,
isValid: isValidNameServiceName,
address: resolvedAddress,
} = useNameServiceStatus();

Expand Down Expand Up @@ -162,7 +163,8 @@ function PreSendAddress() {
toAddress,
);
} catch (error0) {
if (disableSubmitBtn) return;
if (isValidNameServiceName && !resolvedAddress)
return undefined;
return intl.formatMessage({
id: 'form__address_invalid',
});
Expand Down

0 comments on commit 1edc8fd

Please sign in to comment.