Skip to content

Commit

Permalink
fix: forward timeout waitForFileChooser
Browse files Browse the repository at this point in the history
  • Loading branch information
jrandolf committed Aug 30, 2022
1 parent e2d9858 commit f185969
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 f185969

Please sign in to comment.