From df11d8e7aa77ffb4df0ab4b60541677805786128 Mon Sep 17 00:00:00 2001 From: Philippe Pittoli Date: Sun, 21 May 2023 22:10:20 +0200 Subject: [PATCH] Compiles again. --- src/App/Messages/AuthenticationDaemon.purs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/App/Messages/AuthenticationDaemon.purs b/src/App/Messages/AuthenticationDaemon.purs index 82bca1f..73f68e6 100644 --- a/src/App/Messages/AuthenticationDaemon.purs +++ b/src/App/Messages/AuthenticationDaemon.purs @@ -10,7 +10,7 @@ import Data.Codec.Argonaut as CA import Data.Maybe import Data.Either import Data.Codec.Argonaut.Record as CAR -import Data.UInt (fromInt, UInt) +import Data.UInt (fromInt, toInt, UInt) import Data.Tuple (Tuple(..)) import Data.ArrayBuffer.ArrayBuffer as ArrayBuffer @@ -180,9 +180,10 @@ serialize request deserialize :: ArrayBuffer -> Effect (Either DecodeError AnswerMessage) deserialize arraybuffer = do - case (IPC.fromTypedIPC arraybuffer) of + value <- liftEffect $ IPC.fromTypedIPC arraybuffer + pure $ case (value) of Left err -> Left (UnknownError $ show err) - Right (Tuple messageTypeNumber string) -> case (decode messageTypeNumber $ J.fromString string) of + Right (Tuple messageTypeNumber string) -> case (decode (toInt messageTypeNumber) $ J.fromString string) of Left parsingError -> Left parsingError Right answerMessage -> Right answerMessage