1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-18 01:57:02 +00:00

ui: Move ClearFlash & ViewMailbox into Layout

This commit is contained in:
James Hillyerd
2019-02-17 11:57:10 -08:00
parent cfbd30d8b0
commit 34799b9a04
2 changed files with 46 additions and 33 deletions

View File

@@ -61,7 +61,7 @@ init configValue location key =
Home.init session
initModel =
{ layout = Layout.init LayoutMsg ClearFlash ViewMailbox
{ layout = Layout.init LayoutMsg
, page = Home subModel
}
@@ -79,8 +79,6 @@ type Msg
| LinkClicked UrlRequest
| SessionUpdated (Result D.Error Session.Persistent)
| TimeZoneLoaded Time.Zone
| ClearFlash
| ViewMailbox String
| LayoutMsg Layout.Msg
| HomeMsg Home.Msg
| MailboxMsg Mailbox.Msg
@@ -179,11 +177,6 @@ updateMain msg model session =
, Cmd.none
)
ClearFlash ->
( applyToModelSession Session.clearFlash model
, Cmd.none
)
SessionUpdated (Ok persistent) ->
( updateSession model { session | persistent = persistent }
, Cmd.none
@@ -205,13 +198,14 @@ updateMain msg model session =
, Cmd.none
)
ViewMailbox name ->
( applyToModelSession Session.clearFlash model
, Route.pushUrl session.key (Route.Mailbox name)
)
LayoutMsg subMsg ->
( { model | layout = Layout.update subMsg model.layout }, Cmd.none )
let
( layout, newSession, cmd ) =
Layout.update subMsg model.layout session
in
( updateSession { model | layout = layout } newSession
, cmd
)
_ ->
updatePage msg model