1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-28 12:45:45 +01:00

fix for empty password history

This commit is contained in:
Kyle Spearrin 2019-05-11 20:38:07 -04:00
parent 7b1ffbbcc9
commit 741e060d99

View File

@ -140,12 +140,16 @@ export class OnePassword1PifImporter extends BaseImporter implements Importer {
private parsePasswordHistory(items: any[], cipher: CipherView) { private parsePasswordHistory(items: any[], cipher: CipherView) {
const maxSize = items.length > 5 ? 5 : items.length; const maxSize = items.length > 5 ? 5 : items.length;
cipher.passwordHistory = items.sort((a, b) => b.time - a.time).slice(0, maxSize).map((entry: any) => { cipher.passwordHistory = items
const ph = new PasswordHistoryView(); .filter((h: any) => !this.isNullOrWhitespace(h.value) && h.time != null)
ph.password = entry.value; .sort((a, b) => b.time - a.time)
ph.lastUsedDate = new Date(entry.time * 1000); .slice(0, maxSize)
return ph; .map((h: any) => {
}); const ph = new PasswordHistoryView();
ph.password = h.value;
ph.lastUsedDate = new Date(h.time * 1000);
return ph;
});
} }
private parseFields(fields: any[], cipher: CipherView, designationKey: string, valueKey: string, nameKey: string) { private parseFields(fields: any[], cipher: CipherView, designationKey: string, valueKey: string, nameKey: string) {