From 634b30bbf57147139fec3a22f1af90c32379a5de Mon Sep 17 00:00:00 2001 From: Philippe Pittoli Date: Wed, 5 Jul 2023 03:18:01 +0200 Subject: [PATCH] Change some log messages. --- src/App/AuthenticationForm.purs | 2 +- src/App/DNSManagerDomainsInterface.purs | 2 +- src/App/WS.purs | 14 +++++--------- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/App/AuthenticationForm.purs b/src/App/AuthenticationForm.purs index 3f5936a..729d148 100644 --- a/src/App/AuthenticationForm.purs +++ b/src/App/AuthenticationForm.purs @@ -234,7 +234,7 @@ handleQuery = case _ of pure (Just a) -- The authentication was a success! (AuthD.GotToken msg) -> do - H.raise $ AppendMessage $ "[🎉] Authenticated!" + H.raise $ AppendMessage $ "[🎉] Authenticated to authd!" H.raise $ AuthToken (Tuple msg.uid msg.token) pure (Just a) -- WTH?! diff --git a/src/App/DNSManagerDomainsInterface.purs b/src/App/DNSManagerDomainsInterface.purs index 2a47741..e38066e 100644 --- a/src/App/DNSManagerDomainsInterface.purs +++ b/src/App/DNSManagerDomainsInterface.purs @@ -258,7 +258,7 @@ handleQuery = case _ of handleAction $ UpdateAcceptedDomains response.domains (DNSManager.MkLogged response) -> do - H.raise $ AppendMessage $ "[😈] Authenticated!" + H.raise $ AppendMessage $ "[🎉] Authenticated to dnsmanagerd!" handleAction $ UpdateAcceptedDomains response.accepted_domains handleAction $ UpdateMyDomains response.my_domains diff --git a/src/App/WS.purs b/src/App/WS.purs index 7c8da93..2814b5e 100644 --- a/src/App/WS.purs +++ b/src/App/WS.purs @@ -112,7 +112,7 @@ handleAction action = do handleAction ConnectWebSocket Finalize -> do - H.raise $ AppendSystemMessage $ "Closing websocket for '" <> wsInfo.url <> "'" + -- H.raise $ AppendSystemMessage $ "Closing websocket for '" <> wsInfo.url <> "'" case wsInfo.connection of Nothing -> H.raise $ AppendSystemMessage "No socket? How is that even possible?" Just socket -> H.liftEffect $ WS.close socket @@ -121,7 +121,7 @@ handleAction action = do H.raise $ AppendSystemMessage $ renderError (UnknownError error) ConnectWebSocket -> do - H.raise $ AppendSystemMessage ("Connecting to \"" <> wsInfo.url <> "\"...") + -- H.raise $ AppendSystemMessage $ "Connecting to \"" <> wsInfo.url <> "\"..." webSocket <- H.liftEffect $ WS.create wsInfo.url [] H.liftEffect $ WS.setBinaryType webSocket ArrayBuffer H.modify_ _ { wsInfo { connection = Just webSocket } } @@ -136,11 +136,11 @@ handleAction action = do HandleWebSocket wsEvent -> do case wsEvent of WebSocketMessage received_message -> do + -- H.raise $ AppendMessage $ "[😈] Received a message" H.raise $ MessageReceived $ Tuple wsInfo.url received_message.message - H.raise $ AppendMessage $ "[😈] Received a message" WebSocketOpen -> do - H.raise $ AppendSystemMessage ("Successfully connected to WebSocket at \"" <> wsInfo.url <> "\"!🎉") + -- H.raise $ AppendSystemMessage ("Successfully connected to \"" <> wsInfo.url <> "\"!🎉") H.raise $ WSJustConnected WebSocketClose { code, reason, wasClean } -> do @@ -168,11 +168,7 @@ handleAction action = do baseCloseMessage = String.joinWith " " [ "Connection to WebSocket closed" - , "[ CODE:" - , show code - , "|" - , if wasClean then "CLEAN" else "DIRTY" - , "]" + , "[ CODE:" , show code , "|" , if wasClean then "CLEAN" else "DIRTY" , "]" ] handleQuery :: forall a m. MonadAff m => Query a -> H.HalogenM State Action () Output m (Maybe a)