1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-06 11:43:51 +00:00

fix(extension-device-approval): [PM-14943] Answering Service Full Implementation - Minor changes to default server notifications service.

This commit is contained in:
Patrick Pimentel
2025-08-28 15:35:26 -04:00
parent 7d853aa5c9
commit d944ae12ca

View File

@@ -165,9 +165,24 @@ export class DefaultServerNotificationsService implements ServerNotificationsSer
}
private hasAccessToken$(userId: UserId) {
return this.authService.authStatusFor$(userId).pipe(
map((authStatus) => authStatus === AuthenticationStatus.Unlocked),
distinctUntilChanged(),
return this.configService.getFeatureFlag$(FeatureFlag.PushNotificationsWhenLocked).pipe(
switchMap((featureFlagEnabled) => {
if (featureFlagEnabled) {
return this.authService.authStatusFor$(userId).pipe(
map(
(authStatus) =>
authStatus === AuthenticationStatus.Locked ||
authStatus === AuthenticationStatus.Unlocked,
),
distinctUntilChanged(),
);
} else {
return this.authService.authStatusFor$(userId).pipe(
map((authStatus) => authStatus === AuthenticationStatus.Unlocked),
distinctUntilChanged(),
);
}
}),
);
}