Skip to content

Commit

Permalink
fix: 🐛 deck could exit while rendering
Browse files Browse the repository at this point in the history
When press a "q" button for exit the deck while some animation is still
in process, it closes the deck, return the shell, but still rendering
the deck. This behaviour is fixed in this commit. Now, you can not exit
the deck if it still rendering.
  • Loading branch information
ghaiklor committed May 8, 2020
1 parent a9f7e89 commit 387c15f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/kittik-deck/src/Deck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ export class Deck extends EventEmitter {

// eslint-disable-next-line class-methods-use-this
public exit (): void {
if (this.isRendering) return;

process.stdin.pause();
process.stdin.removeAllListeners();

Expand Down

0 comments on commit 387c15f

Please sign in to comment.