From 80cd30d7d8b1566d7ecedcf71d381b0e897280d0 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Sat, 17 Feb 2018 22:51:28 -0500 Subject: [PATCH] dont init history --- src/services/passwordGeneration.service.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/services/passwordGeneration.service.ts b/src/services/passwordGeneration.service.ts index 20d526a405..09b728c050 100644 --- a/src/services/passwordGeneration.service.ts +++ b/src/services/passwordGeneration.service.ts @@ -148,7 +148,7 @@ export class PasswordGenerationService implements PasswordGenerationServiceAbstr } private optionsCache: any; - private history: PasswordHistory[] = []; + private history: PasswordHistory[]; constructor(private cryptoService: CryptoService, private storageService: StorageService) { } @@ -203,11 +203,11 @@ export class PasswordGenerationService implements PasswordGenerationServiceAbstr return; } - currentHistory.push(new PasswordHistory(password, Date.now())); + currentHistory.unshift(new PasswordHistory(password, Date.now())); // Remove old items. if (currentHistory.length > MaxPasswordsInHistory) { - currentHistory.shift(); + currentHistory.pop(); } const newHistory = await this.encryptHistory(currentHistory);