Skip to content

Commit

Permalink
fix: use nextTimeout variable
Browse files Browse the repository at this point in the history
Signed-off-by: Pascal Sthamer <10992664+P4sca1@users.noreply.github.com>
  • Loading branch information
P4sca1 committed Apr 29, 2024
1 parent 42ba463 commit 0a067a8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ export function longTimeout(
let nextTimeout = timeout
let remainingTimeout = 0

if (timeout > TIMEOUT_MAX) {
remainingTimeout = timeout - TIMEOUT_MAX
if (nextTimeout > TIMEOUT_MAX) {
remainingTimeout = nextTimeout - TIMEOUT_MAX
nextTimeout = TIMEOUT_MAX
}

Expand All @@ -34,7 +34,7 @@ export function longTimeout(
} else {
fn()
}
}, timeout)
}, nextTimeout)

return handle
}
Expand Down

0 comments on commit 0a067a8

Please sign in to comment.