From aa908fcf7072c0e27d242ecf7014174f9de16965 Mon Sep 17 00:00:00 2001 From: Nathanael Sensfelder Date: Sat, 29 Sep 2018 13:09:53 +0200 Subject: ... --- src/popup/src/Comm/Send.elm | 28 ++++++---------------------- src/popup/src/Struct/ServerReply.elm | 3 +-- src/popup/src/Update/StoreParams.elm | 2 +- 3 files changed, 8 insertions(+), 25 deletions(-) (limited to 'src/popup') diff --git a/src/popup/src/Comm/Send.elm b/src/popup/src/Comm/Send.elm index cda4cf2..1a939c5 100644 --- a/src/popup/src/Comm/Send.elm +++ b/src/popup/src/Comm/Send.elm @@ -1,10 +1,9 @@ -module Comm.Send exposing (try_sending) +module Comm.Send exposing (commit) -- Elm ------------------------------------------------------------------------- import Http import Json.Decode -import Json.Encode -- Extension ------------------------------------------------------------------- import Comm.Okay @@ -41,24 +40,9 @@ decoder = -------------------------------------------------------------------------------- -- EXPORTED -------------------------------------------------------------------- -------------------------------------------------------------------------------- -try_sending : ( - Struct.Model.Type -> - String -> - (Struct.Model.Type -> (Maybe Json.Encode.Value)) -> - (Maybe (Cmd Struct.Event.Type)) +commit : String -> (Cmd Struct.Event.Type) +commit query = + (Http.send + Struct.Event.ServerReplied + (Http.get query (Json.Decode.list (decoder))) ) -try_sending model recipient try_encoding_fun = - case (try_encoding_fun model) of - (Just serial) -> - (Just - (Http.send - Struct.Event.ServerReplied - (Http.post - recipient - (Http.jsonBody serial) - (Json.Decode.list (decoder)) - ) - ) - ) - - Nothing -> Nothing diff --git a/src/popup/src/Struct/ServerReply.elm b/src/popup/src/Struct/ServerReply.elm index e995f63..cc9d372 100644 --- a/src/popup/src/Struct/ServerReply.elm +++ b/src/popup/src/Struct/ServerReply.elm @@ -2,8 +2,7 @@ module Struct.ServerReply exposing (Type(..)) -- Elm ------------------------------------------------------------------------- --- ------------------------------------------------------------------- -import Struct.BattleSummary +-- Extension ------------------------------------------------------------------- -------------------------------------------------------------------------------- -- TYPES ----------------------------------------------------------------------- diff --git a/src/popup/src/Update/StoreParams.elm b/src/popup/src/Update/StoreParams.elm index f369be8..3472c13 100644 --- a/src/popup/src/Update/StoreParams.elm +++ b/src/popup/src/Update/StoreParams.elm @@ -24,7 +24,7 @@ apply_to : Struct.Model.Type -> (Struct.Model.Type, (Cmd Struct.Event.Type)) apply_to model = ( model, - (Action.Ports.store_params + (Action.Ports.set_params ( (Struct.Flags.get_frequency model.flags), (Json.Encode.encode -- cgit v1.2.3-70-g09d2