From ea0046783b9cf0e37177f5f1f54c39bc2b1d9a38 Mon Sep 17 00:00:00 2001 From: Philippe Pittoli Date: Tue, 30 May 2023 16:42:52 +0200 Subject: [PATCH] Simplify a few things. --- src/App/AuthenticationForm.purs | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/src/App/AuthenticationForm.purs b/src/App/AuthenticationForm.purs index d9252c2..be109a3 100644 --- a/src/App/AuthenticationForm.purs +++ b/src/App/AuthenticationForm.purs @@ -109,30 +109,16 @@ decodeMessageEvent = \msgEvent -> do --------------------------- data ErrorType - = MessageIsServerAdvertisement String - | UnknownError String + = UnknownError String | UnknownWebSocketError renderError :: ErrorType -> String renderError = case _ of UnknownError str -> "Unknown error: " <> str - MessageIsServerAdvertisement str -> - "Received following advertisment from server: " <> str UnknownWebSocketError -> "Unknown 'error' event has been fired by WebSocket event listener" --------------------------------------------------------------------------------- --- `Main` function --------------------------------------------------------------------------------- - -main :: Effect Unit -main = do - HA.runHalogenAff do - body <- HA.awaitBody - let url = "ws://localhost:8080" - runUI component url body - -------------------------------------------------------------------------------- -- WebSocket message type -------------------------------------------------------------------------------- @@ -205,7 +191,7 @@ wrapperStyle = """ render :: forall m. State -> H.ComponentHTML Action () m -render { messages, loginInputText, passInputText, wsConnection, canReconnect, messageHistoryLength } = +render { messages, loginInputText, passInputText, wsConnection, canReconnect, messageHistoryLength } = HH.div [ HP.style wrapperStyle ] [ HH.h2_ [ HH.text "Authentication!" ]