aboutsummaryrefslogtreecommitdiff
path: root/src/client/Model.elm
diff options
context:
space:
mode:
authorJoris2015-11-01 11:58:42 +0100
committerJoris2015-11-01 11:58:42 +0100
commitc015db01e2acee9d1fc83cd6a762d0a3e629b353 (patch)
tree9e6b8f5fa04a3ce6cca51f5cae4cc8fbf6a0f5ed /src/client/Model.elm
parentd3e045e8034c5473964c0529ffc1e181311842c2 (diff)
downloadbudget-c015db01e2acee9d1fc83cd6a762d0a3e629b353.tar.gz
budget-c015db01e2acee9d1fc83cd6a762d0a3e629b353.tar.bz2
budget-c015db01e2acee9d1fc83cd6a762d0a3e629b353.zip
Use in client the real currency set in config.txt
Diffstat (limited to 'src/client/Model.elm')
-rw-r--r--src/client/Model.elm13
1 files changed, 8 insertions, 5 deletions
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 = "" }
}