From 42f1f8b49aeb0ec8bc31b7165a0a7c57b273d325 Mon Sep 17 00:00:00 2001 From: Piotr Pekala Date: Wed, 2 Oct 2019 07:07:52 -0700 Subject: [PATCH] Update lock-action.component.ts --- .../actions/lock-action/lock-action.component.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/components/project-map/context-menu/actions/lock-action/lock-action.component.ts b/src/app/components/project-map/context-menu/actions/lock-action/lock-action.component.ts index 5b75c63e..8557917e 100644 --- a/src/app/components/project-map/context-menu/actions/lock-action/lock-action.component.ts +++ b/src/app/components/project-map/context-menu/actions/lock-action/lock-action.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, OnInit, Input, OnDestroy, OnChanges } from '@angular/core'; import { Server } from '../../../../../models/server'; import { Node } from '../../../../../cartography/models/node'; import { NodesDataSource } from '../../../../../cartography/datasources/nodes-datasource'; @@ -11,7 +11,7 @@ import { DrawingService } from '../../../../../services/drawing.service'; selector: 'app-lock-action', templateUrl: './lock-action.component.html' }) -export class LockActionComponent implements OnInit { +export class LockActionComponent implements OnChanges { @Input() server: Server; @Input() nodes: Node[]; @Input() drawings: Drawing[]; @@ -24,7 +24,7 @@ export class LockActionComponent implements OnInit { private drawingService: DrawingService ) {} - ngOnInit() { + ngOnChanges() { if (this.nodes.length === 1 && this.drawings.length === 0) { this.command = this.nodes[0].locked ? 'Unlock item' : 'Lock item'; } else if (this.nodes.length === 0 && this.drawings.length === 1) {