Skip to content

Commit

Permalink
fix: only remove the item from the if it is done
Browse files Browse the repository at this point in the history
  • Loading branch information
KieraDOG committed Aug 12, 2024
1 parent 6816179 commit 1751cab
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/CGDGarageDoor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,12 @@ export class CGDGarageDoor {
return;
}

const item = this.runQ.shift()!;
const item = this.runQ[0];

try {
await item.fn();
} finally {
this.runQ.shift();
this.processRunQ();
}
};
Expand Down

0 comments on commit 1751cab

Please sign in to comment.