Skip to content

Commit 5c3cd08

Browse files
authored
[LW-8962] Fix debounce time for handle resolver and wrong verifying setting for status (#690)
* fix: fixes debounce time for handle resolver too low and wrong setting for verifying status * feat(core): adds disable state on input field for verifying handles * feat(core): adjusting time out of handle validation * feat(core): adding disabled state UI on verifying changes * feat(core): simplifying a line in core for focus state
1 parent 0d1a629 commit 5c3cd08

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ export const AddressInput = ({ row, currentNetwork, isPopupView }: AddressInputP
9797
const resolveHandle = useMemo(
9898
() =>
9999
debounce(async () => {
100+
setHandleVerificationState(HandleVerificationState.VERIFYING);
101+
100102
if (isAddressInputInvalidHandle) {
101103
setHandleVerificationState(HandleVerificationState.INVALID);
102104
}
@@ -166,7 +168,6 @@ export const AddressInput = ({ row, currentNetwork, isPopupView }: AddressInputP
166168
}
167169

168170
if (isAddressInputValueHandle) {
169-
setHandleVerificationState(HandleVerificationState.VERIFYING);
170171
resolveHandle();
171172
} else {
172173
setHandleVerificationState(undefined);

packages/core/src/ui/components/DestinationAddressInput/DestinationAddressInput.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ export const DestinationAddressInput = ({
6565
const [focused, setFocused] = useState<boolean>(false);
6666

6767
useEffect(() => {
68-
if (value.name) setFocused(false);
69-
}, [value]);
68+
if (value.name && handle === HandleVerificationState.VERIFYING) setFocused(false);
69+
}, [value, handle]);
7070

7171
const customIcon = useMemo(() => {
7272
let Icon;
@@ -118,7 +118,7 @@ export const DestinationAddressInput = ({
118118
options={options}
119119
loading={handle === HandleVerificationState.VERIFYING}
120120
customIcon={customIcon}
121-
disabled={exists}
121+
disabled={exists || handle === HandleVerificationState.VERIFYING}
122122
invalid={valid === false}
123123
onInputBlur={() => setFocused(false)}
124124
onInputFocus={() => setFocused(true)}

packages/core/src/ui/utils/handle.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const ADA_HANDLE_PREFIX = '$';
22
const ADA_HANDLE_THRESHOLD = 2;
33

4-
export const HANDLE_DEBOUNCE_TIME = 1000;
4+
export const HANDLE_DEBOUNCE_TIME = 700;
55
export const isHandle = (value: string): boolean =>
66
value !== undefined &&
77
value.length > 0 &&

0 commit comments

Comments
 (0)