Skip to content

Commit

Permalink
adjust the code
Browse files Browse the repository at this point in the history
  • Loading branch information
JKobrynski committed Apr 8, 2024
1 parent 723014d commit 632926f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
7 changes: 4 additions & 3 deletions .github/actions/javascript/awaitStagingDeploys/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12754,12 +12754,13 @@ function promiseDoWhile(condition, action) {
console.info('[promiseWhile] promiseDoWhile() condition', condition);
const actionResult = action?.();
console.info('[promiseWhile] promiseDoWhile() actionResult', actionResult);
if (actionResult === undefined) {
if (!actionResult) {
resolve();
return;
}
actionResult
?.then(() => promiseWhile(condition, action))
.then(() => resolve())
.then(() => promiseWhile(condition, action))
.then(resolve)
.catch(reject);
});
}
Expand Down
8 changes: 4 additions & 4 deletions .github/libs/promiseWhile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ function promiseDoWhile(condition: () => boolean, action: (() => Promise<void>)
console.info('[promiseWhile] promiseDoWhile() condition', condition);
const actionResult = action?.();
console.info('[promiseWhile] promiseDoWhile() actionResult', actionResult);

if (actionResult === undefined) {
if (!actionResult) {
resolve();
return;
}

actionResult
?.then(() => promiseWhile(condition, action))
.then(() => resolve())
.then(() => promiseWhile(condition, action))
.then(resolve)
.catch(reject);
});
}
Expand Down

0 comments on commit 632926f

Please sign in to comment.