diff options
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 -> [] } |