Skip to content

Commit

Permalink
Merge pull request #51848 from getusha/fix-resend-timer-not-starting
Browse files Browse the repository at this point in the history
[CP Staging] fix: remove unnecessary condition

(cherry picked from commit c92106e)

(CP triggered by Beamanator)
  • Loading branch information
Beamanator authored and OSBotify committed Nov 4, 2024
1 parent b3aa9a1 commit d2de946
Showing 1 changed file with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ function BaseValidateCodeForm({
const shouldDisableResendValidateCode = !!isOffline || account?.isLoading;
const focusTimeoutRef = useRef<NodeJS.Timeout | null>(null);
const [timeRemaining, setTimeRemaining] = useState(CONST.REQUEST_CODE_DELAY as number);
const [isResent, setIsResent] = useState(false);

const timerRef = useRef<NodeJS.Timeout>();

Expand Down Expand Up @@ -155,10 +154,6 @@ function BaseValidateCodeForm({
* Request a validate code / magic code be sent to verify this contact method
*/
const resendValidateCode = () => {
if (hasMagicCodeBeenSent && !isResent) {
return;
}

sendValidateCode();
inputValidateCodeRef.current?.clear();
setTimeRemaining(CONST.REQUEST_CODE_DELAY);
Expand Down Expand Up @@ -229,10 +224,7 @@ function BaseValidateCodeForm({
<PressableWithFeedback
disabled={shouldDisableResendValidateCode}
style={[styles.mr1]}
onPress={() => {
resendValidateCode();
setIsResent(true);
}}
onPress={resendValidateCode}
underlayColor={theme.componentBG}
hoverDimmingValue={1}
pressDimmingValue={0.2}
Expand Down

0 comments on commit d2de946

Please sign in to comment.