From b20504dfb90ee3f8ddb34e3d22b701d014307d38 Mon Sep 17 00:00:00 2001 From: Philippe Pittoli Date: Sun, 18 Jun 2023 02:34:52 +0200 Subject: [PATCH] Messages are sent and received, but something fails. --- src/App/Container.purs | 4 ++-- src/App/DNSManagerDomainsInterface.purs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/App/Container.purs b/src/App/Container.purs index 36f41fa..6bfbefc 100644 --- a/src/App/Container.purs +++ b/src/App/Container.purs @@ -67,9 +67,9 @@ render state render_newdomain_interface :: forall monad. MonadAff monad => H.ComponentHTML Action ChildSlots monad render_newdomain_interface = Bulma.box $ case state.token of - Just _ -> + Just token -> [ Bulma.h1 "New domain interface!" - , HH.slot_ _ndi unit NewDomainInterface.component "ws://127.0.0.1:8081" + , HH.slot_ _ndi unit NewDomainInterface.component (Tuple "ws://127.0.0.1:8081" token) ] Nothing -> [ Bulma.p "Here will be the new domain box." ] diff --git a/src/App/DNSManagerDomainsInterface.purs b/src/App/DNSManagerDomainsInterface.purs index 944f905..407f2ce 100644 --- a/src/App/DNSManagerDomainsInterface.purs +++ b/src/App/DNSManagerDomainsInterface.purs @@ -287,7 +287,6 @@ handleAction = case _ of H.liftEffect $ WS.setBinaryType webSocket ArrayBuffer H.modify_ _ { wsConnection = Just webSocket } void $ H.subscribe (HandleWebSocket <$> webSocketEmitter webSocket) - handleAction AuthenticateToDNSManager AuthenticateToDNSManager -> do { wsConnection, token } <- H.get @@ -372,6 +371,7 @@ handleAction = case _ of WebSocketOpen -> do { wsUrl } <- H.get systemMessage ("Successfully connected to WebSocket at \"" <> wsUrl <> "\"!🎉") + handleAction AuthenticateToDNSManager WebSocketClose { code, reason, wasClean } -> do systemMessage $ renderCloseMessage code wasClean reason