diff options
author | Joris Guyonvarch | 2015-08-11 21:32:10 +0200 |
---|---|---|
committer | Joris Guyonvarch | 2015-08-11 21:32:10 +0200 |
commit | 892a7dd19a92fc18767984e624b8a5026dce61e4 (patch) | |
tree | 7d59d58d96958e91a4e9114be0effb9ec7a082a8 /src/client/Model.elm | |
parent | a3bab4f2a0cc8a6a95753dc91d8e862f40c80dcc (diff) |
Showing server sides generated messages from the client
Diffstat (limited to 'src/client/Model.elm')
-rw-r--r-- | src/client/Model.elm | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/client/Model.elm b/src/client/Model.elm index 45fdf87..72db56a 100644 --- a/src/client/Model.elm +++ b/src/client/Model.elm @@ -4,16 +4,23 @@ module Model ) where import Time exposing (Time) +import Json.Decode as Json import Model.View exposing (..) +import Model.Translations exposing (..) type alias Model = { view : View , currentTime : Time + , translations : Translations } -initialModel : Time -> Model -initialModel initialTime = +initialModel : Time -> String -> Model +initialModel initialTime translationsValue = { view = LoadingView , currentTime = initialTime + , translations = + case Json.decodeString translationsDecoder translationsValue of + Ok translations -> translations + Err err -> [] } |