1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-05 09:10:53 +01:00

set organizationUseTotp on organizationChanged

This commit is contained in:
Kyle Spearrin 2018-10-19 12:18:53 -04:00
parent 194374ea73
commit c946f01b5f

View File

@ -313,12 +313,16 @@ export class AddEditComponent implements OnInit {
u.showOptions = u.showOptions == null ? true : u.showOptions; u.showOptions = u.showOptions == null ? true : u.showOptions;
} }
organizationChanged() { async organizationChanged() {
if (this.writeableCollections != null) { if (this.writeableCollections != null) {
this.writeableCollections.forEach((c) => (c as any).checked = false); this.writeableCollections.forEach((c) => (c as any).checked = false);
} }
if (this.cipher.organizationId != null) { if (this.cipher.organizationId != null) {
this.collections = this.writeableCollections.filter((c) => c.organizationId === this.cipher.organizationId); this.collections = this.writeableCollections.filter((c) => c.organizationId === this.cipher.organizationId);
const org = await this.userService.getOrganization(this.cipher.organizationId);
if (org != null) {
this.cipher.organizationUseTotp = org.useTotp;
}
} else { } else {
this.collections = []; this.collections = [];
} }