Skip to content

Commit d45434e

Browse files
fix(extension): [LW-10446] remove handle from getExistingAddress check (#1137)
* fix(extension): remove handle from DestinationAddressInput disabling check * fix(extension): improve existing address check
1 parent 2f2b1b2 commit d45434e

File tree

1 file changed

+13
-1
lines changed
  • apps/browser-extension-wallet/src/views/browser-view/features/send-transaction/components/Form

1 file changed

+13
-1
lines changed

apps/browser-extension-wallet/src/views/browser-view/features/send-transaction/components/Form/AddressInput.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,18 @@ export const AddressInput = ({ row, currentNetwork, isPopupView }: AddressInputP
286286
(isAddressInputValueHandle || isAddressInputInvalidHandle) &&
287287
handleVerificationState === HandleVerificationState.INVALID;
288288

289+
const exists = () => {
290+
if (handleVerificationState === HandleVerificationState.VALID) {
291+
return Boolean(getExistingAddress(handle));
292+
}
293+
294+
if (address.startsWith('$')) {
295+
return false;
296+
}
297+
298+
return Boolean(getExistingAddress(address));
299+
};
300+
289301
return (
290302
<span className={styles.container}>
291303
<DestinationAddressInput
@@ -297,7 +309,7 @@ export const AddressInput = ({ row, currentNetwork, isPopupView }: AddressInputP
297309
empty={!address}
298310
valid={isAddressInputValueValid}
299311
validationObject={validationObject}
300-
exists={!!getExistingAddress(handle || address)}
312+
exists={exists()}
301313
className={styles.input}
302314
style={{ width: '100%' }}
303315
open

0 commit comments

Comments
 (0)