1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-17 09:37:02 +00:00

ui: Unknown routes redirect to Home

This commit is contained in:
James Hillyerd
2019-02-18 12:51:49 -08:00
parent a54e0f2438
commit cd89d77d9f

View File

@@ -245,17 +245,6 @@ changeRouteTo route model =
{ model | layout = Layout.reset model.layout }
in
case route of
Route.Unknown path ->
let
flash =
{ title = "Unknown route requested"
, table = [ ( "Path", path ) ]
}
in
( applyToModelSession (Session.showFlash flash) newModel
, Cmd.none
)
Route.Home ->
Home.init session
|> updateWith Home HomeMsg newModel
@@ -276,7 +265,7 @@ changeRouteTo route model =
else
let
flash =
{ title = "Unknown route requested"
{ title = "Disabled route requested"
, table = [ ( "Error", "Monitor disabled by configuration." ) ]
}
in
@@ -288,6 +277,17 @@ changeRouteTo route model =
Status.init session
|> updateWith Status StatusMsg newModel
Route.Unknown path ->
-- Unknown routes display Home with an error flash.
let
flash =
{ title = "Unknown route requested"
, table = [ ( "Path", path ) ]
}
in
Home.init (Session.showFlash flash session)
|> updateWith Home HomeMsg newModel
getSession : Model -> Session
getSession model =