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

bug fix + added launch time to view component (#178)

This commit is contained in:
Addison Beck 2020-09-23 13:53:43 -04:00 committed by GitHub
parent 26d40d4c43
commit b5cc5409ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -196,11 +196,15 @@ export class ViewComponent implements OnDestroy, OnInit {
}
}
launch(uri: LoginUriView) {
launch(uri: LoginUriView, cipherId?: string) {
if (!uri.canLaunch) {
return;
}
if (cipherId) {
this.cipherService.updateLastLaunchedDate(cipherId);
}
this.platformUtilsService.eventTrack('Launched Login URI');
this.platformUtilsService.launchUri(uri.launchUri);
}

View File

@ -57,7 +57,8 @@ class Ciphers {
}
getLastLaunched() {
const sortedCiphers = this.ciphers.sort((x, y) => y.localData?.lastLaunched?.valueOf() - x.localData?.lastLaunched?.valueOf());
const usedCiphers = this.ciphers.filter(cipher => cipher.localData?.lastLaunched)
const sortedCiphers = usedCiphers.sort((x, y) => y.localData.lastLaunched.valueOf() - x.localData.lastLaunched.valueOf());
return sortedCiphers[0];
}