Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix: use the timeout setting in waitForFileChooser (#8856)
Co-authored-by: Randolf J <jrandolf@google.com>
  • Loading branch information
OrKoN and jrandolf committed Aug 30, 2022
1 parent 8d95a9b commit f477b46
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/util/DeferredPromise.ts
Expand Up @@ -31,10 +31,13 @@ export function createDeferredPromiseWithTimer<T>(
resolver = resolve;
rejector = reject;
});
const timeoutId = setTimeout(() => {
isRejected = true;
rejector(new TimeoutError(timeoutMessage));
}, timeout);
const timeoutId =
timeout > 0
? setTimeout(() => {
isRejected = true;
rejector(new TimeoutError(timeoutMessage));
}, timeout)
: undefined;
return Object.assign(taskPromise, {
resolved: () => {
return isResolved;
Expand Down

0 comments on commit f477b46

Please sign in to comment.