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:
@@ -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>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user