mirror of
https://github.com/bitwarden/browser
synced 2026-03-01 19:11:22 +00:00
fix(browser-approval): [PM-23620] Auth Request Answering Service - Moved subscribing to main.background.ts.
This commit is contained in:
@@ -4,8 +4,5 @@ import { UserId } from "@bitwarden/user-core";
|
||||
export abstract class AuthRequestAnsweringServiceAbstraction {
|
||||
abstract receivedPendingAuthRequest(userId: UserId, notificationId: string): Promise<void>;
|
||||
|
||||
abstract handleAuthRequestNotificationClicked(
|
||||
event: SystemNotificationEvent,
|
||||
authRequestId: string,
|
||||
): Promise<void>;
|
||||
abstract handleAuthRequestNotificationClicked(event: SystemNotificationEvent): Promise<void>;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { filter, firstValueFrom, map, switchMap } from "rxjs";
|
||||
import { firstValueFrom } from "rxjs";
|
||||
|
||||
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
|
||||
import { AuthService } from "@bitwarden/common/auth/abstractions/auth.service";
|
||||
@@ -25,15 +25,8 @@ export class AuthRequestAnsweringService implements AuthRequestAnsweringServiceA
|
||||
private readonly masterPasswordService: MasterPasswordServiceAbstraction,
|
||||
private readonly platformUtilsService: PlatformUtilsService,
|
||||
private readonly systemNotificationsService: SystemNotificationsService,
|
||||
) {
|
||||
this.systemNotificationsService.notificationClicked$
|
||||
.pipe(
|
||||
filter((n) => n.id.startsWith("authRequest_")),
|
||||
map((n) => ({ event: n, authRequestId: n.id.split("_")[1] })),
|
||||
switchMap(({ event }) => this.handleAuthRequestNotificationClicked(event)),
|
||||
)
|
||||
.subscribe();
|
||||
}
|
||||
) {}
|
||||
|
||||
async handleAuthRequestNotificationClicked(event: SystemNotificationEvent): Promise<void> {
|
||||
if (event.buttonIdentifier === ButtonLocation.NotificationButton) {
|
||||
// await this.systemNotificationsService.clear({
|
||||
|
||||
Reference in New Issue
Block a user