Skip to content

Commit

Permalink
Fix isValidating state from showing invalid address (#18963)
Browse files Browse the repository at this point in the history
## Description 

Prevent showing errors during isValidator.




Describe the changes or additions included in this PR.

## Test plan 

How did you test the new or updated feature?

---

## Release notes

Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.

For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.

- [ ] Protocol: 
- [ ] Nodes (Validators and Full nodes): 
- [ ] Indexer: 
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
- [ ] REST API:
  • Loading branch information
Jibz-Mysten authored Aug 12, 2024
1 parent f8176eb commit 88d4fd4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions apps/wallet/src/ui/app/components/address-input/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export function AddressInput({
refetchInterval: false,
});

const { isSubmitting, setFieldValue } = useFormikContext();
const { isSubmitting, setFieldValue, isValidating } = useFormikContext();
const suiAddressValidation = useSuiAddressValidation();

const disabled = forcedDisabled !== undefined ? forcedDisabled : isSubmitting;
Expand All @@ -92,7 +92,7 @@ export function AddressInput({
setFieldValue('to', '');
}, [setFieldValue]);

const hasWarningOrError = meta.touched && (meta.error || warningData);
const hasWarningOrError = meta.touched && (meta.error || warningData) && !isValidating;

return (
<>
Expand Down Expand Up @@ -132,7 +132,7 @@ export function AddressInput({
</div>
</div>

{meta.touched ? (
{meta.touched && !isValidating ? (
<div className="mt-2.5 w-full">
<Alert noBorder rounded="lg" mode={meta.error || warningData ? 'issue' : 'success'}>
{warningData === RecipientWarningType.OBJECT ? (
Expand Down

0 comments on commit 88d4fd4

Please sign in to comment.