From faa556dd98a710041a8ab50c381ebfc138583a14 Mon Sep 17 00:00:00 2001 From: Eduardo Asafe Date: Tue, 23 Jul 2024 15:09:30 -0300 Subject: [PATCH] Notification permission for pwa --- src/Client/Im/Main.purs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Client/Im/Main.purs b/src/Client/Im/Main.purs index 0a0b23b3..4660552d 100644 --- a/src/Client/Im/Main.purs +++ b/src/Client/Im/Main.purs @@ -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