1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-10 21:33:27 +00:00

[PM-19244] add missing null check, fix feature flag logic, cleanup (#13850)

* add missing null check, fix feature flag logic, cleanup

* add null check
This commit is contained in:
Brandon Treston
2025-03-18 16:42:02 -04:00
committed by GitHub
parent 17a60d0226
commit 69b2972e56

View File

@@ -219,23 +219,24 @@ export class VaultHeaderComponent implements OnInit {
}
async addCollection(): Promise<void> {
const organization = this.organizations?.find(
(org) => org.productTierType === ProductTierType.Free,
);
const isBreadcrumbEventLogsEnabled = await firstValueFrom(
this.configService.getFeatureFlag$(FeatureFlag.PM12276_BreadcrumbEventLogs),
);
if (
this.organizations.length == 1 &&
organization.productTierType === ProductTierType.Free &&
isBreadcrumbEventLogsEnabled
) {
const collections = await this.collectionAdminService.getAll(organization.id);
if (collections.length === organization.maxCollections) {
await this.showFreeOrgUpgradeDialog(organization);
return;
if (isBreadcrumbEventLogsEnabled) {
const organization = this.organizations?.find(
(org) => org.productTierType === ProductTierType.Free,
);
if (this.organizations?.length == 1 && !!organization) {
const collections = await this.collectionAdminService.getAll(organization.id);
if (collections.length === organization.maxCollections) {
await this.showFreeOrgUpgradeDialog(organization);
return;
}
}
}
this.onAddCollection.emit();
}