1
0
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:
Nick Krantz
2025-07-07 09:26:34 -05:00
committed by GitHub
parent 2e03b8cbac
commit b54c40ff00
3 changed files with 4 additions and 4 deletions

View File

@@ -29,5 +29,5 @@ export enum NotificationType {
Notification = 20, Notification = 20,
NotificationStatus = 21, NotificationStatus = 21,
PendingSecurityTasks = 22, RefreshSecurityTasks = 22,
} }

View File

@@ -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]);

View File

@@ -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),