diff options
author | Joris | 2017-03-26 21:10:42 +0200 |
---|---|---|
committer | Joris | 2017-03-26 21:10:42 +0200 |
commit | 1e47a7754ca38bd1a6c74765d8378caf68ce4619 (patch) | |
tree | d0d9238479dc2529a1b558bbbcde346e7e8c2935 /src/client/elm/Model.elm | |
parent | c0ac16a713c4e53cf6af8e72a6d5f6b8ac5d6456 (diff) | |
download | budget-1e47a7754ca38bd1a6c74765d8378caf68ce4619.tar.gz budget-1e47a7754ca38bd1a6c74765d8378caf68ce4619.tar.bz2 budget-1e47a7754ca38bd1a6c74765d8378caf68ce4619.zip |
Separate client and server watch
Diffstat (limited to 'src/client/elm/Model.elm')
-rw-r--r-- | src/client/elm/Model.elm | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/src/client/elm/Model.elm b/src/client/elm/Model.elm deleted file mode 100644 index 5167e42..0000000 --- a/src/client/elm/Model.elm +++ /dev/null @@ -1,74 +0,0 @@ -module Model exposing - ( Model - , init - ) - -import Time exposing (Time) -import Json.Decode as Decode - -import Navigation exposing (Location) - -import Html as Html - -import Page exposing (Page) -import Init as Init exposing (Init) -import Msg exposing (Msg) - -import Model.View exposing (..) -import Model.Translations exposing (..) -import Model.Conf exposing (..) -import Model.InitResult exposing (..) -import LoggedIn.Model as LoggedInModel -import SignIn.Model as SignInModel - -import Dialog -import Dialog.Model as DialogModel -import Dialog.Msg as DialogMsg - -import Tooltip - -import Utils.Maybe exposing (isJust) - -type alias Model = - { view : View - , currentTime : Time - , translations : Translations - , conf : Conf - , page : Page - , errors : List String - , dialog : Dialog.Model DialogModel.Model DialogMsg.Msg Msg - , tooltip : Tooltip.Model - } - -init : Decode.Value -> Location -> (Model, Cmd Msg) -init payload location = - let model = - case Decode.decodeValue Init.decoder payload of - Ok { time, translations, conf, result, windowSize } -> - { view = - case result of - InitEmpty -> - SignInView (SignInModel.init Nothing) - InitSuccess init -> - LoggedInView (LoggedInModel.init init) - InitError error -> - SignInView (SignInModel.init (Just error)) - , currentTime = time - , translations = translations - , conf = conf - , page = Page.fromLocation location - , errors = [] - , dialog = Dialog.init DialogModel.init Msg.Dialog - , tooltip = Tooltip.init windowSize.width windowSize.height - } - Err error -> - { view = SignInView (SignInModel.init (Just error)) - , currentTime = 0 - , translations = [] - , conf = { currency = "" } - , page = Page.fromLocation location - , errors = [ error ] - , dialog = Dialog.init DialogModel.init Msg.Dialog - , tooltip = Tooltip.init 0 0 - } - in (model, Cmd.none) |