Skip to content

Commit

Permalink
Merge pull request #85 from sahell0x/fix/83/limit-otp-try-again
Browse files Browse the repository at this point in the history
disable try again button after otp is sent
  • Loading branch information
itsmdasifraza authored Dec 14, 2024
2 parents 0e9b0d4 + 75fc99c commit 4d69f2b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/pages/Auth/verify-email/VerifyEmail.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
import Redirect from '../redirect/Redirect.svelte';
import constants from '$lib/utils/constants';
export let id: string;
let isTryAgainButtonDisabled = false;
let seconds = 60;
const verifyString = writable('');
let verifyLength: string = '';
Expand Down Expand Up @@ -118,6 +119,7 @@
});
let resentCodeLoader = false;
const handleResend = async () => {
isTryAgainButtonDisabled = true;
resentCodeLoader = true;
const response = await sendUserEmailVerification({ email: id });
if (response.isSuccessful) {
Expand All @@ -135,6 +137,7 @@
notifications.error(response.message);
}
resentCodeLoader = false;
isTryAgainButtonDisabled = false;
};
const onCodeInput = () => {
errorMessageText.set('');
Expand Down Expand Up @@ -542,6 +545,7 @@
title={'Try again'}
buttonClassProp={'w-100 py-2 align-items-center d-flex justify-content-center sparrow-fs-16'}
type={'primary'}
disable={isTryAgainButtonDisabled}
/>
{/if}
</div>
Expand Down

0 comments on commit 4d69f2b

Please sign in to comment.