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:
@@ -23,4 +23,5 @@ export enum NotificationType {
|
||||
|
||||
SyncOrganizations = 17,
|
||||
SyncOrganizationStatusChanged = 18,
|
||||
SyncOrganizationCollectionSettingChanged = 19,
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user