Skip to content

Commit

Permalink
fix: 🐛 deck is not clearing up canvas when showing\exiting
Browse files Browse the repository at this point in the history
When Deck instance is created, it does not reset the canvas by default.
The same applies when exiting the deck, it does not reset it. With this
commit it will reset the canvas and show\hide cursor by default, when
entering the presentation mode and exiting from it.
  • Loading branch information
ghaiklor committed May 11, 2020
1 parent c9b0942 commit 2224e57
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/kittik-deck/src/Deck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export declare interface Deck {
}

export class Deck extends EventEmitter {
public canvas: Canvas = Canvas.create();
public canvas: Canvas = Canvas.create().reset().hideCursor();
private readonly slides: Slide[] = [];
private isRendering = false;
private currentSlideIndex = 0;
Expand Down Expand Up @@ -117,6 +117,7 @@ export class Deck extends EventEmitter {
process.stdin.pause();
process.stdin.removeAllListeners();

this.canvas.reset().showCursor();
this.emit('exit');
}

Expand Down

0 comments on commit 2224e57

Please sign in to comment.