From 952de9c6ee2677dde51018a555566a8ebd655648 Mon Sep 17 00:00:00 2001 From: lue-bird Date: Sun, 3 Dec 2023 19:26:41 +0100 Subject: [PATCH] missing decoder for AddWindowSizeRequest + --- src/Web.elm | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/Web.elm b/src/Web.elm index eb7ace6..59fa26d 100644 --- a/src/Web.elm +++ b/src/Web.elm @@ -1074,10 +1074,10 @@ interfaceDiffToJson = \interfaceDiff -> case interfaceDiff of InterfaceWithReceiveDiff addOrReplaceDiff -> - addOrReplaceDiff |> interfaceAddOrReplaceDiffToJson + addOrReplaceDiff |> interfaceWithReceiveDiffToJson InterfaceWithoutReceiveDiff removeDiff -> - removeDiff |> interfaceRemoveDiffToJson + removeDiff |> interfaceWithoutReceiveDiffToJson domNodeIdToJson : DomNodeId -> Json.Encode.Value @@ -1169,8 +1169,8 @@ httpBodyToJson = Json.Encode.null -interfaceAddOrReplaceDiffToJson : InterfaceWithReceiveDiff -> Json.Encode.Value -interfaceAddOrReplaceDiffToJson = +interfaceWithReceiveDiffToJson : InterfaceWithReceiveDiff -> Json.Encode.Value +interfaceWithReceiveDiffToJson = \interfaceAddOrReplaceDiff -> Json.Encode.object [ case interfaceAddOrReplaceDiff of @@ -1219,8 +1219,8 @@ interfaceAddOrReplaceDiffToJson = ] -interfaceRemoveDiffToJson : InterfaceWithoutReceiveDiff -> Json.Encode.Value -interfaceRemoveDiffToJson = +interfaceWithoutReceiveDiffToJson : InterfaceWithoutReceiveDiff -> Json.Encode.Value +interfaceWithoutReceiveDiffToJson = \interfaceRemoveDiff -> Json.Encode.object [ case interfaceRemoveDiff of @@ -1322,7 +1322,7 @@ programSubscriptions appConfig = -- re-associate event based on current interface appConfig.ports.fromJs (\interfaceJson -> - case interfaceJson |> Json.Decode.decodeValue (Json.Decode.field "diff" interfaceDiffJsonDecoder) of + case interfaceJson |> Json.Decode.decodeValue (Json.Decode.field "diff" interfaceDiffWithReceiveJsonDecoder) of Ok interfaceDiff -> case state.interface @@ -1359,8 +1359,8 @@ domNodeIdJsonDecoder = ] -interfaceDiffJsonDecoder : Json.Decode.Decoder InterfaceWithReceiveDiff -interfaceDiffJsonDecoder = +interfaceDiffWithReceiveJsonDecoder : Json.Decode.Decoder InterfaceWithReceiveDiff +interfaceDiffWithReceiveJsonDecoder = Json.Decode.oneOf [ Json.Decode.map (\() -> AddTimePosixRequest) (Json.Decode.field "addTimePosixRequest" (Json.Decode.null ())) @@ -1385,6 +1385,8 @@ interfaceDiffJsonDecoder = ) , Json.Decode.map AddHttpRequest (Json.Decode.field "addHttpRequest" httpRequestIdJsonDecoder) + , Json.Decode.map (\() -> AddWindowSizeRequest) + (Json.Decode.field "addWindowSizeRequest" (Json.Decode.null ())) , Json.Decode.map AddWindowEventListen (Json.Decode.field "addWindowEventListen" Json.Decode.string) , Json.Decode.map (\() -> AddWindowAnimationFrameListen)