From 041a2a92d541fe63d0236e737d3e4a7e501d8fd8 Mon Sep 17 00:00:00 2001 From: Austin Warren Date: Wed, 17 Jul 2019 17:10:22 -0700 Subject: [PATCH] Dont emit destroyed event when we're closing all tabs. This is to ensure we don't save the state of our open tabs innapropriately --- terminus-core/src/components/baseTab.component.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/terminus-core/src/components/baseTab.component.ts b/terminus-core/src/components/baseTab.component.ts index 982e88a1..8b4eb942 100644 --- a/terminus-core/src/components/baseTab.component.ts +++ b/terminus-core/src/components/baseTab.component.ts @@ -147,13 +147,15 @@ export abstract class BaseTabComponent { /** * Called before the tab is closed */ - destroy (): void { + destroy (skipDestroyedEvent = false): void { this.focused.complete() this.blurred.complete() this.titleChange.complete() this.progress.complete() this.recoveryStateChangedHint.complete() - this.destroyed.next() + if (!skipDestroyedEvent) { + this.destroyed.next() + } this.destroyed.complete() } }