From c015db01e2acee9d1fc83cd6a762d0a3e629b353 Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 1 Nov 2015 11:58:42 +0100 Subject: Use in client the real currency set in config.txt --- src/client/Model.elm | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/client/Model.elm') diff --git a/src/client/Model.elm b/src/client/Model.elm index c330d86..43a19c5 100644 --- a/src/client/Model.elm +++ b/src/client/Model.elm @@ -8,22 +8,25 @@ import Json.Decode as Json import Model.View exposing (..) import Model.Translations exposing (..) -import Model.Conf exposing (..) +import Model.Config exposing (..) type alias Model = { view : View , currentTime : Time , translations : Translations - , conf : Conf + , config : Config } -initialModel : Time -> String -> Model -initialModel initialTime translationsValue = +initialModel : Time -> String -> String -> Model +initialModel initialTime translationsValue configValue = { view = LoadingView , currentTime = initialTime , translations = case Json.decodeString translationsDecoder translationsValue of Ok translations -> translations Err err -> [] - , conf = { currency = "€" } + , config = + case Json.decodeString configDecoder configValue of + Ok config -> config + Err err -> { currency = "" } } -- cgit v1.2.3