1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-06 00:13:28 +00:00

[PM-13764] - Update Collection Settings (#12734)

* Updating org when collection settings change.
This commit is contained in:
Jared McCannon
2025-01-09 10:32:21 -06:00
committed by GitHub
parent 20c8eda986
commit 3550a904dc
4 changed files with 37 additions and 0 deletions

View File

@@ -23,4 +23,5 @@ export enum NotificationType {
SyncOrganizations = 17,
SyncOrganizationStatusChanged = 18,
SyncOrganizationCollectionSettingChanged = 19,
}

View File

@@ -45,6 +45,9 @@ export class NotificationResponse extends BaseResponse {
case NotificationType.SyncOrganizationStatusChanged:
this.payload = new OrganizationStatusPushNotification(payload);
break;
case NotificationType.SyncOrganizationCollectionSettingChanged:
this.payload = new OrganizationCollectionSettingChangedPushNotification(payload);
break;
default:
break;
}
@@ -126,3 +129,17 @@ export class OrganizationStatusPushNotification extends BaseResponse {
this.enabled = this.getResponseProperty("Enabled");
}
}
export class OrganizationCollectionSettingChangedPushNotification extends BaseResponse {
organizationId: string;
limitCollectionCreation: boolean;
limitCollectionDeletion: boolean;
constructor(response: any) {
super(response);
this.organizationId = this.getResponseProperty("OrganizationId");
this.limitCollectionCreation = this.getResponseProperty("LimitCollectionCreation");
this.limitCollectionDeletion = this.getResponseProperty("LimitCollectionDeletion");
}
}

View File

@@ -227,6 +227,11 @@ export class NotificationsService implements NotificationsServiceAbstraction {
await this.syncService.fullSync(true);
}
break;
case NotificationType.SyncOrganizationCollectionSettingChanged:
if (isAuthenticated) {
await this.syncService.fullSync(true);
}
break;
default:
break;
}