1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 08:43:33 +00:00

improved some syntax and a few fixes

This commit is contained in:
Kyle Spearrin
2019-04-13 21:20:04 -04:00
parent 42771c1a2d
commit b7a736294b
7 changed files with 17 additions and 53 deletions

View File

@@ -48,12 +48,7 @@ export class CipherData {
this.type = response.type;
this.name = response.name;
this.notes = response.notes;
if (collectionIds != null) {
this.collectionIds = collectionIds;
} else {
this.collectionIds = response.collectionIds;
}
this.collectionIds = collectionIds != null ? collectionIds : response.collectionIds;
switch (this.type) {
case CipherType.Login:
@@ -73,24 +68,13 @@ export class CipherData {
}
if (response.fields != null) {
this.fields = [];
response.fields.forEach((field) => {
this.fields.push(new FieldData(field));
});
this.fields = response.fields.map((f) => new FieldData(f));
}
if (response.attachments != null) {
this.attachments = [];
response.attachments.forEach((attachment) => {
this.attachments.push(new AttachmentData(attachment));
});
this.attachments = response.attachments.map((a) => new AttachmentData(a));
}
if (response.passwordHistory != null) {
this.passwordHistory = [];
response.passwordHistory.forEach((ph) => {
this.passwordHistory.push(new PasswordHistoryData(ph));
});
this.passwordHistory = response.passwordHistory.map((ph) => new PasswordHistoryData(ph));
}
}
}