Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
xnerhu committed Nov 26, 2023
1 parent 0f0dbb8 commit f003445
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/sources/notification_permissions.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import { BotdError, BrowserEngineKind, State } from '../types'
import { getBrowserEngineKind, isDesktopWebKit } from '../utils/browser'
import { BotdError, BrowserEngineKind, BrowserKind, State } from '../types'
import { getBrowserEngineKind, getBrowserKind, isDesktopWebKit } from '../utils/browser'

export default async function getNotificationPermissions(): Promise<boolean> {
if (window.Notification === undefined) {
// if on mobile ios, ignore
if (getBrowserEngineKind() === BrowserEngineKind.Webkit && !isDesktopWebKit()) {
if (
getBrowserKind() === BrowserKind.Safari &&
getBrowserEngineKind() === BrowserEngineKind.Webkit &&
!isDesktopWebKit()
) {
return false
}
throw new BotdError(State.Undefined, 'window.Notification is undefined')
Expand Down

0 comments on commit f003445

Please sign in to comment.