mirror of
https://github.com/bitwarden/browser
synced 2025-12-11 05:43:41 +00:00
Refactor PendingSecurityTasks to RefreshSecurityTasks (#15021)
- Allows for more general use case of security task notifications
This commit is contained in:
@@ -29,5 +29,5 @@ export enum NotificationType {
|
|||||||
Notification = 20,
|
Notification = 20,
|
||||||
NotificationStatus = 21,
|
NotificationStatus = 21,
|
||||||
|
|
||||||
PendingSecurityTasks = 22,
|
RefreshSecurityTasks = 22,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -365,7 +365,7 @@ describe("Default task service", () => {
|
|||||||
const subscription = service.listenForTaskNotifications();
|
const subscription = service.listenForTaskNotifications();
|
||||||
|
|
||||||
const notification = {
|
const notification = {
|
||||||
type: NotificationType.PendingSecurityTasks,
|
type: NotificationType.RefreshSecurityTasks,
|
||||||
} as NotificationResponse;
|
} as NotificationResponse;
|
||||||
mockNotifications$.next([notification, userId]);
|
mockNotifications$.next([notification, userId]);
|
||||||
|
|
||||||
@@ -390,7 +390,7 @@ describe("Default task service", () => {
|
|||||||
const subscription = service.listenForTaskNotifications();
|
const subscription = service.listenForTaskNotifications();
|
||||||
|
|
||||||
const notification = {
|
const notification = {
|
||||||
type: NotificationType.PendingSecurityTasks,
|
type: NotificationType.RefreshSecurityTasks,
|
||||||
} as NotificationResponse;
|
} as NotificationResponse;
|
||||||
mockNotifications$.next([notification, "other-user-id" as UserId]);
|
mockNotifications$.next([notification, "other-user-id" as UserId]);
|
||||||
|
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ export class DefaultTaskService implements TaskService {
|
|||||||
return this.notificationService.notifications$.pipe(
|
return this.notificationService.notifications$.pipe(
|
||||||
filter(
|
filter(
|
||||||
([notification, userId]) =>
|
([notification, userId]) =>
|
||||||
notification.type === NotificationType.PendingSecurityTasks &&
|
notification.type === NotificationType.RefreshSecurityTasks &&
|
||||||
filterByUserIds.includes(userId),
|
filterByUserIds.includes(userId),
|
||||||
),
|
),
|
||||||
map(([, userId]) => userId),
|
map(([, userId]) => userId),
|
||||||
|
|||||||
Reference in New Issue
Block a user