diff --git a/jslib b/jslib index e371d737b0..9e9795fd85 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit e371d737b0d3db99f195c3317ecf9eaa16bd19b3 +Subproject commit 9e9795fd855d643459a9205c5299bfbf887d4985 diff --git a/src/popup/vault/ciphers.component.ts b/src/popup/vault/ciphers.component.ts index e804449f27..a241102a4b 100644 --- a/src/popup/vault/ciphers.component.ts +++ b/src/popup/vault/ciphers.component.ts @@ -15,6 +15,7 @@ import { import { BrowserApi } from '../../browser/browserApi'; +import { CipherService } from 'jslib/abstractions/cipher.service'; import { CollectionService } from 'jslib/abstractions/collection.service'; import { FolderService } from 'jslib/abstractions/folder.service'; import { I18nService } from 'jslib/abstractions/i18n.service'; @@ -62,7 +63,8 @@ export class CiphersComponent extends BaseCiphersComponent implements OnInit, On private changeDetectorRef: ChangeDetectorRef, private stateService: StateService, private popupUtils: PopupUtilsService, private i18nService: I18nService, private folderService: FolderService, private collectionService: CollectionService, - private analytics: Angulartics2, private platformUtilsService: PlatformUtilsService) { + private analytics: Angulartics2, private platformUtilsService: PlatformUtilsService, + private cipherService: CipherService) { super(searchService); this.pageSize = 100; this.applySavedState = (window as any).previousPopupUrl != null && @@ -195,6 +197,7 @@ export class CiphersComponent extends BaseCiphersComponent implements OnInit, On } this.preventSelected = true; this.analytics.eventTrack.next({ action: 'Launched URI From Listing' }); + await this.cipherService.updateLastLaunchedDate(cipher.id); BrowserApi.createNewTab(cipher.login.launchUri); if (this.popupUtils.inPopup(window)) { BrowserApi.closePopup(window); diff --git a/src/popup/vault/groupings.component.ts b/src/popup/vault/groupings.component.ts index d32f9a3152..84aca18084 100644 --- a/src/popup/vault/groupings.component.ts +++ b/src/popup/vault/groupings.component.ts @@ -286,6 +286,7 @@ export class GroupingsComponent extends BaseGroupingsComponent implements OnInit } this.preventSelected = true; this.analytics.eventTrack.next({ action: 'Launched URI From Listing' }); + await this.cipherService.updateLastLaunchedDate(cipher.id); BrowserApi.createNewTab(cipher.login.launchUri); if (this.popupUtils.inPopup(window)) { BrowserApi.closePopup(window); diff --git a/src/services/autofill.service.ts b/src/services/autofill.service.ts index 250d8619fb..74912f26dc 100644 --- a/src/services/autofill.service.ts +++ b/src/services/autofill.service.ts @@ -231,7 +231,13 @@ export default class AutofillService implements AutofillServiceInterface { if (fromCommand) { cipher = await this.cipherService.getNextCipherForUrl(tab.url); } else { - cipher = await this.cipherService.getLastUsedForUrl(tab.url); + const lastLaunchedCipher = await this.cipherService.getLastLaunchedForUrl(tab.url); + if (lastLaunchedCipher && Date.now().valueOf() - lastLaunchedCipher.localData?.lastLaunched?.valueOf() < 30000) { + cipher = lastLaunchedCipher; + } + else { + cipher = await this.cipherService.getLastUsedForUrl(tab.url); + } } const autoFillResponse = await this.doAutoFill({