Skip to content

Commit

Permalink
Notification permission for pwa
Browse files Browse the repository at this point in the history
  • Loading branch information
easafe committed Jul 23, 2024
1 parent 519945a commit faa556d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Client/Im/Main.purs
Original file line number Diff line number Diff line change
Expand Up @@ -728,13 +728,12 @@ toggleConnectedWebSocket isConnected model@{ hasTriedToConnectYet, errorMessage
preventStop Event ImModel NextMessage
preventStop event model = CIF.nothingNext model <<< liftEffect $ CCD.preventStop event

checkNotifications Boolean -> Effect Unit
checkNotifications Boolean Effect Unit
checkNotifications smallScreen = do
status ← CCD.notificationPermission
when (status == "default") $ do
matches ← DT.traverse CCD.mediaMatches [ "fullscreen", "standalone", "minimal-ui" ] --check if we are running as pwa instead of a web page
{- when (DT.or matches || not smallScreen) $ -}
FS.send imId ToggleAskNotification
when (DT.or matches || not smallScreen) $ FS.send imId ToggleAskNotification

--refactor use popstate subscription
historyChange Boolean Effect Unit
Expand Down

0 comments on commit faa556d

Please sign in to comment.