mirror of
https://github.com/bitwarden/browser
synced 2025-12-12 06:13:38 +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> {
|
async addCollection(): Promise<void> {
|
||||||
const organization = this.organizations?.find(
|
|
||||||
(org) => org.productTierType === ProductTierType.Free,
|
|
||||||
);
|
|
||||||
const isBreadcrumbEventLogsEnabled = await firstValueFrom(
|
const isBreadcrumbEventLogsEnabled = await firstValueFrom(
|
||||||
this.configService.getFeatureFlag$(FeatureFlag.PM12276_BreadcrumbEventLogs),
|
this.configService.getFeatureFlag$(FeatureFlag.PM12276_BreadcrumbEventLogs),
|
||||||
);
|
);
|
||||||
if (
|
|
||||||
this.organizations.length == 1 &&
|
if (isBreadcrumbEventLogsEnabled) {
|
||||||
organization.productTierType === ProductTierType.Free &&
|
const organization = this.organizations?.find(
|
||||||
isBreadcrumbEventLogsEnabled
|
(org) => org.productTierType === ProductTierType.Free,
|
||||||
) {
|
);
|
||||||
|
|
||||||
|
if (this.organizations?.length == 1 && !!organization) {
|
||||||
const collections = await this.collectionAdminService.getAll(organization.id);
|
const collections = await this.collectionAdminService.getAll(organization.id);
|
||||||
if (collections.length === organization.maxCollections) {
|
if (collections.length === organization.maxCollections) {
|
||||||
await this.showFreeOrgUpgradeDialog(organization);
|
await this.showFreeOrgUpgradeDialog(organization);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.onAddCollection.emit();
|
this.onAddCollection.emit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user