Skip to content

Commit 77f4d00

Browse files
committed
Fix browser desktop
1 parent 30b7db7 commit 77f4d00

File tree

5 files changed

+15
-6
lines changed

5 files changed

+15
-6
lines changed

apps/browser/src/vault/popup/components/vault-v2/vault-list-items-container/vault-list-items-container.component.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import { AccountService } from "@bitwarden/common/auth/abstractions/account.serv
2323
import { getUserId } from "@bitwarden/common/auth/services/account.service";
2424
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
2525
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
26+
import { uuidAsString } from "@bitwarden/common/platform/abstractions/sdk/sdk.service";
2627
import { CipherId } from "@bitwarden/common/types/guid";
2728
import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service";
2829
import { CipherType } from "@bitwarden/common/vault/enums";
@@ -321,7 +322,7 @@ export class VaultListItemsContainerComponent implements AfterViewInit {
321322
}
322323

323324
const activeUserId = await firstValueFrom(this.accountService.activeAccount$.pipe(getUserId));
324-
await this.cipherService.updateLastLaunchedDate(cipher.id!, activeUserId);
325+
await this.cipherService.updateLastLaunchedDate(uuidAsString(cipher.id!), activeUserId);
325326

326327
await BrowserApi.createNewTab(launchURI);
327328

@@ -338,7 +339,7 @@ export class VaultListItemsContainerComponent implements AfterViewInit {
338339

339340
// When only the `CipherListView` is available, fetch the full cipher details
340341
const activeUserId = await firstValueFrom(this.accountService.activeAccount$.pipe(getUserId));
341-
const _cipher = await this.cipherService.get(cipher.id!, activeUserId);
342+
const _cipher = await this.cipherService.get(uuidAsString(cipher.id!), activeUserId);
342343
const cipherView = await this.cipherService.decrypt(_cipher, activeUserId);
343344

344345
await this.vaultPopupAutofillService.doAutofill(cipherView);

apps/browser/src/vault/popup/services/vault-popup-items.service.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { OrganizationService } from "@bitwarden/common/admin-console/abstraction
88
import { Organization } from "@bitwarden/common/admin-console/models/domain/organization";
99
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
1010
import { ProductTierType } from "@bitwarden/common/billing/enums";
11+
import { uuidAsString } from "@bitwarden/common/platform/abstractions/sdk/sdk.service";
1112
import { Utils } from "@bitwarden/common/platform/misc/utils";
1213
import { SyncService } from "@bitwarden/common/platform/sync";
1314
import { ObservableTracker, mockAccountServiceWith } from "@bitwarden/common/spec";
@@ -102,7 +103,7 @@ describe("VaultPopupItemsService", () => {
102103

103104
searchService.searchCiphers.mockImplementation(async (userId, _, __, ciphers) => ciphers);
104105
cipherServiceMock.filterCiphersForUrl.mockImplementation(async (ciphers) =>
105-
ciphers.filter((c) => ["0", "1"].includes(c.id)),
106+
ciphers.filter((c) => ["0", "1"].includes(uuidAsString(c.id))),
106107
);
107108
vaultSettingsServiceMock.showCardsCurrentTab$ = new BehaviorSubject(false);
108109
vaultSettingsServiceMock.showIdentitiesCurrentTab$ = new BehaviorSubject(false);

apps/browser/src/vault/popup/services/vault-popup-list-filters.service.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import { ProductTierType } from "@bitwarden/common/billing/enums";
2828
import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum";
2929
import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service";
3030
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
31+
import { asUuid } from "@bitwarden/common/platform/abstractions/sdk/sdk.service";
3132
import { Utils } from "@bitwarden/common/platform/misc/utils";
3233
import {
3334
KeyDefinition,
@@ -236,7 +237,10 @@ export class VaultPopupListFiltersService {
236237
return false;
237238
}
238239

239-
if (filters.collection && !cipher.collectionIds?.includes(filters.collection.id!)) {
240+
if (
241+
filters.collection &&
242+
!cipher.collectionIds?.includes(asUuid(filters.collection.id!))
243+
) {
240244
return false;
241245
}
242246

apps/desktop/src/vault/app/vault/vault-items-v2.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { distinctUntilChanged } from "rxjs";
77
import { JslibModule } from "@bitwarden/angular/jslib.module";
88
import { VaultItemsComponent as BaseVaultItemsComponent } from "@bitwarden/angular/vault/components/vault-items.component";
99
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
10+
import { uuidAsString } from "@bitwarden/common/platform/abstractions/sdk/sdk.service";
1011
import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service";
1112
import { SearchService } from "@bitwarden/common/vault/abstractions/search.service";
1213
import { RestrictedItemTypesService } from "@bitwarden/common/vault/services/restricted-item-types.service";
@@ -42,6 +43,6 @@ export class VaultItemsV2Component<C extends CipherViewLike> extends BaseVaultIt
4243
}
4344

4445
trackByFn(index: number, c: C): string {
45-
return c.id!;
46+
return uuidAsString(c.id!);
4647
}
4748
}

libs/angular/src/vault/vault-filter/models/vault-filter.model.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// FIXME: Update this file to be type safe and remove this and next line
22
// @ts-strict-ignore
3+
import { asUuid } from "@bitwarden/common/platform/abstractions/sdk/sdk.service";
34
import { CipherType } from "@bitwarden/common/vault/enums";
45
import {
56
CipherViewLike,
@@ -65,7 +66,8 @@ export class VaultFilter {
6566
}
6667
if (this.selectedCollection && this.selectedCollectionId != null && cipherPassesFilter) {
6768
cipherPassesFilter =
68-
cipher.collectionIds != null && cipher.collectionIds.includes(this.selectedCollectionId);
69+
cipher.collectionIds != null &&
70+
cipher.collectionIds.includes(asUuid(this.selectedCollectionId));
6971
}
7072
if (this.selectedOrganizationId != null && cipherPassesFilter) {
7173
cipherPassesFilter = cipher.organizationId === this.selectedOrganizationId;

0 commit comments

Comments
 (0)