1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-23 03:33:54 +00:00

option to not show cards/identities on current tab list

This commit is contained in:
Kyle Spearrin
2018-11-21 14:31:34 -05:00
parent 100f9589bb
commit f043010067
5 changed files with 66 additions and 6 deletions

View File

@@ -22,8 +22,11 @@ import { CipherService } from 'jslib/abstractions/cipher.service';
import { I18nService } from 'jslib/abstractions/i18n.service';
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
import { SearchService } from 'jslib/abstractions/search.service';
import { StorageService } from 'jslib/abstractions/storage.service';
import { SyncService } from 'jslib/abstractions/sync.service';
import { ConstantsService } from 'jslib/services/constants.service';
import { AutofillService } from '../../services/abstractions/autofill.service';
import { PopupUtilsService } from '../services/popup-utils.service';
@@ -59,7 +62,7 @@ export class CurrentTabComponent implements OnInit, OnDestroy {
private i18nService: I18nService, private router: Router,
private ngZone: NgZone, private broadcasterService: BroadcasterService,
private changeDetectorRef: ChangeDetectorRef, private syncService: SyncService,
private searchService: SearchService) { }
private searchService: SearchService, private storageService: StorageService) { }
async ngOnInit() {
this.showLeftHeader = !this.platformUtilsService.isSafari();
@@ -203,10 +206,19 @@ export class CurrentTabComponent implements OnInit, OnDestroy {
sender: BroadcasterSubscriptionId,
});
const ciphers = await this.cipherService.getAllDecryptedForUrl(this.url, [
CipherType.Card,
CipherType.Identity,
]);
const otherTypes: CipherType[] = [];
const dontShowCards = await this.storageService.get<boolean>(ConstantsService.dontShowCardsCurrentTab);
const dontShowIdentities = await this.storageService.get<boolean>(
ConstantsService.dontShowIdentitiesCurrentTab);
if (!dontShowCards) {
otherTypes.push(CipherType.Card);
}
if (!dontShowIdentities) {
otherTypes.push(CipherType.Identity);
}
const ciphers = await this.cipherService.getAllDecryptedForUrl(this.url,
otherTypes.length > 0 ? otherTypes : null);
this.loginCiphers = [];
this.cardCiphers = [];