Skip to content

Commit 88c5f3f

Browse files
committed
fix: remove redundant isActive parameter from useMagicCodePaste
1 parent b8fd39e commit 88c5f3f

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/components/MagicCodeInput.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ const TEXT_INPUT_EMPTY_STATE = '';
2020
/**
2121
* Trims whitespace from pasted magic codes
2222
*/
23-
const useMagicCodePaste = (inputRef: React.RefObject<BaseTextInputRef | null>, onChangeText: (value: string) => void, isActive: boolean) => {
23+
const useMagicCodePaste = (inputRef: React.RefObject<BaseTextInputRef | null>, onChangeText: (value: string) => void) => {
2424
useEffect(() => {
25-
if (!isActive || typeof document === 'undefined') {
25+
if (typeof document === 'undefined') {
2626
return;
2727
}
2828

@@ -52,7 +52,7 @@ const useMagicCodePaste = (inputRef: React.RefObject<BaseTextInputRef | null>, o
5252
return () => {
5353
document.removeEventListener('paste', handlePaste, true);
5454
};
55-
}, [inputRef, onChangeText, isActive]);
55+
}, [inputRef, onChangeText]);
5656
};
5757

5858
type AutoCompleteVariant = 'sms-otp' | 'one-time-code' | 'off';
@@ -160,7 +160,7 @@ function MagicCodeInput(
160160
const lastValue = useRef<string | number>(TEXT_INPUT_EMPTY_STATE);
161161
const valueRef = useRef(value);
162162

163-
useMagicCodePaste(inputRef, onChangeTextProp, true);
163+
useMagicCodePaste(inputRef, onChangeTextProp);
164164

165165
useEffect(() => {
166166
lastValue.current = input.length;

0 commit comments

Comments
 (0)