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

Only return ciphers when they exist. (#15716)

conditionals within the template are checking for an empty array rather than an empty ciphers property.
This commit is contained in:
Nick Krantz
2025-07-22 11:30:22 -05:00
committed by GitHub
parent a563e6d910
commit 9839087b00

View File

@@ -146,14 +146,16 @@ export class VaultListItemsContainerComponent implements AfterViewInit {
ciphers: PopupCipherViewLike[];
}[]
>(() => {
const ciphers = this.ciphers();
// Not grouping by type, return a single group with all ciphers
if (!this.groupByType()) {
return [{ ciphers: this.ciphers() }];
if (!this.groupByType() && ciphers.length > 0) {
return [{ ciphers }];
}
const groups: Record<string, PopupCipherViewLike[]> = {};
this.ciphers().forEach((cipher) => {
ciphers.forEach((cipher) => {
let groupKey = "all";
switch (CipherViewLikeUtils.getType(cipher)) {
case CipherType.Card: