1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-20 03:13:55 +00:00

feat(notifications): Ensure UnsupportedSystemNotificationService is registered in browsers that don't support notifications in Angular contexts (#16296)

This commit is contained in:
Justin Baur
2025-09-05 10:34:29 -04:00
committed by GitHub
parent 203a24723b
commit bb6fabd292
4 changed files with 33 additions and 14 deletions

View File

@@ -12,6 +12,16 @@ import {
import { fromChromeEvent } from "../browser/from-chrome-event";
/**
* A check to see if the current browser has the needed API to support the `BrowserSystemNotificationService`.
*
* This check should only be called during dependency creation, if consumers need to know if
* system notifications can be used they should use {@link SystemNotificationsService.isSupported}.
*/
export function isNotificationsSupported() {
return "notifications" in chrome && chrome.notifications != null;
}
export class BrowserSystemNotificationService implements SystemNotificationsService {
notificationClicked$: Observable<SystemNotificationEvent>;