Messages are sent and received, but something fails.

This commit is contained in:
Philippe Pittoli 2023-06-18 02:34:52 +02:00
parent 7dc993ae26
commit b20504dfb9
2 changed files with 3 additions and 3 deletions

View File

@ -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." ]

View File

@ -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