mirror of
https://github.com/bitwarden/browser
synced 2025-12-06 00:13:28 +00:00
organization status changed code changes (#12249)
* organization status changed code changes * Remove the stop so a reconnect can be made
This commit is contained in:
@@ -22,4 +22,5 @@ export enum NotificationType {
|
||||
AuthRequestResponse = 16,
|
||||
|
||||
SyncOrganizations = 17,
|
||||
SyncOrganizationStatusChanged = 18,
|
||||
}
|
||||
|
||||
@@ -42,6 +42,9 @@ export class NotificationResponse extends BaseResponse {
|
||||
case NotificationType.AuthRequestResponse:
|
||||
this.payload = new AuthRequestPushNotification(payload);
|
||||
break;
|
||||
case NotificationType.SyncOrganizationStatusChanged:
|
||||
this.payload = new OrganizationStatusPushNotification(payload);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -112,3 +115,14 @@ export class AuthRequestPushNotification extends BaseResponse {
|
||||
this.userId = this.getResponseProperty("UserId");
|
||||
}
|
||||
}
|
||||
|
||||
export class OrganizationStatusPushNotification extends BaseResponse {
|
||||
organizationId: string;
|
||||
enabled: boolean;
|
||||
|
||||
constructor(response: any) {
|
||||
super(response);
|
||||
this.organizationId = this.getResponseProperty("OrganizationId");
|
||||
this.enabled = this.getResponseProperty("Enabled");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -218,6 +218,11 @@ export class NotificationsService implements NotificationsServiceAbstraction {
|
||||
});
|
||||
}
|
||||
break;
|
||||
case NotificationType.SyncOrganizationStatusChanged:
|
||||
if (isAuthenticated) {
|
||||
await this.syncService.fullSync(true);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user