Skip to content

Commit

Permalink
fix: set sending once
Browse files Browse the repository at this point in the history
  • Loading branch information
ymzuiku committed Oct 8, 2023
1 parent 341e084 commit 2643a6e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/lib/components/send-verification-code.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,16 @@
let times = storable(id + '__times', 0);
export let tabindex = 1;
let buttonTabindex = tabindex - 1;
let sending = false;
async function sendCode() {
if (sending) {
return;
}
sending = true;
setTimeout(() => {
sending = false;
}, 5000);
if (await Promise.resolve(onClick())) {
$times = 60;
sendCodeWait($times, (t) => {
Expand Down

0 comments on commit 2643a6e

Please sign in to comment.