From 356482f9e918cf7e75ad77bd17a7c816ce2b1aa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Farkas=20J=C3=B3zsef?= Date: Fri, 16 Dec 2016 16:46:14 +0100 Subject: [PATCH] Throw error in layer tab when it is not usable --- src/components/popover/tab/layer/layer-tab.component.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/popover/tab/layer/layer-tab.component.ts b/src/components/popover/tab/layer/layer-tab.component.ts index 6fefe13e..08447089 100644 --- a/src/components/popover/tab/layer/layer-tab.component.ts +++ b/src/components/popover/tab/layer/layer-tab.component.ts @@ -60,7 +60,7 @@ export class LayerTabComponent implements OnChanges, Tab { } keyActionValid(): boolean { - return true; + return !this.isNotBase; } fromKeyAction(keyAction: KeyAction): boolean { @@ -78,6 +78,9 @@ export class LayerTabComponent implements OnChanges, Tab { let keyAction = new SwitchLayerAction(); keyAction.isLayerToggleable = this.toggle; keyAction.layer = this.layer; + if (!this.keyActionValid()) { + throw new Error('KeyAction is invalid!'); + } return keyAction; }