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:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user