uncheck all on destroy

This commit is contained in:
Kyle Spearrin 2018-07-27 22:05:03 -04:00
parent 15fc4e5f2d
commit c8909beedd
1 changed files with 6 additions and 1 deletions

View File

@ -2,6 +2,7 @@ import {
Component, Component,
EventEmitter, EventEmitter,
Input, Input,
OnDestroy,
Output, Output,
} from '@angular/core'; } from '@angular/core';
@ -26,7 +27,7 @@ const MaxCheckedCount = 500;
selector: 'app-vault-ciphers', selector: 'app-vault-ciphers',
templateUrl: 'ciphers.component.html', templateUrl: 'ciphers.component.html',
}) })
export class CiphersComponent extends BaseCiphersComponent { export class CiphersComponent extends BaseCiphersComponent implements OnDestroy {
@Input() showAddNew = true; @Input() showAddNew = true;
@Output() onAttachmentsClicked = new EventEmitter<CipherView>(); @Output() onAttachmentsClicked = new EventEmitter<CipherView>();
@Output() onShareClicked = new EventEmitter<CipherView>(); @Output() onShareClicked = new EventEmitter<CipherView>();
@ -43,6 +44,10 @@ export class CiphersComponent extends BaseCiphersComponent {
this.searchPipe = new SearchCiphersPipe(platformUtilsService); this.searchPipe = new SearchCiphersPipe(platformUtilsService);
} }
ngOnDestroy() {
this.selectAll(false);
}
checkCipher(c: CipherView, select?: boolean) { checkCipher(c: CipherView, select?: boolean) {
(c as any).checked = select == null ? !(c as any).checked : select; (c as any).checked = select == null ? !(c as any).checked : select;
} }