diff --git a/src/popup/settings/options.component.ts b/src/popup/settings/options.component.ts
index 17772a32bd5..86317923212 100644
--- a/src/popup/settings/options.component.ts
+++ b/src/popup/settings/options.component.ts
@@ -25,6 +25,8 @@ export class OptionsComponent implements OnInit {
disableContextMenuItem = false;
disableAddLoginNotification = false;
disableChangedPasswordNotification = false;
+ dontShowCards = false;
+ dontShowIdentities = false;
showDisableContextMenu = true;
disableGa = false;
theme: string;
@@ -60,6 +62,9 @@ export class OptionsComponent implements OnInit {
this.disableContextMenuItem = await this.storageService.get(
ConstantsService.disableContextMenuItemKey);
+ this.dontShowCards = await this.storageService.get(ConstantsService.dontShowCardsCurrentTab);
+ this.dontShowIdentities = await this.storageService.get(ConstantsService.dontShowIdentitiesCurrentTab);
+
this.disableAutoTotpCopy = !await this.totpService.isAutoCopyEnabled();
this.disableFavicon = await this.storageService.get(ConstantsService.disableFaviconKey);
@@ -112,6 +117,18 @@ export class OptionsComponent implements OnInit {
this.callAnalytics('Favicon', !this.disableFavicon);
}
+ async updateShowCards() {
+ await this.storageService.save(ConstantsService.dontShowCardsCurrentTab, this.dontShowCards);
+ await this.stateService.save(ConstantsService.dontShowCardsCurrentTab, this.dontShowCards);
+ this.callAnalytics('Show Cards on Current Tab', !this.dontShowCards);
+ }
+
+ async updateShowIdentities() {
+ await this.storageService.save(ConstantsService.dontShowIdentitiesCurrentTab, this.dontShowIdentities);
+ await this.stateService.save(ConstantsService.dontShowIdentitiesCurrentTab, this.dontShowIdentities);
+ this.callAnalytics('Show Identities on Current Tab', !this.dontShowIdentities);
+ }
+
async saveTheme() {
await this.storageService.save(ConstantsService.themeKey, this.theme);
this.analytics.eventTrack.next({ action: 'Set Theme ' + this.theme });
diff --git a/src/popup/vault/current-tab.component.ts b/src/popup/vault/current-tab.component.ts
index eb917992232..1260b3c2c55 100644
--- a/src/popup/vault/current-tab.component.ts
+++ b/src/popup/vault/current-tab.component.ts
@@ -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(ConstantsService.dontShowCardsCurrentTab);
+ const dontShowIdentities = await this.storageService.get(
+ 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 = [];