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

ui: Respect monitor visible config option

This commit is contained in:
James Hillyerd
2018-12-31 14:37:11 -08:00
parent c57260349b
commit 321c5615a5
5 changed files with 33 additions and 7 deletions

View File

@@ -52,7 +52,7 @@ init configValue location key =
session =
case D.decodeValue configDecoder configValue of
Ok config ->
Session.init key location config.session
Session.init key location config.appConfig config.session
Err error ->
Session.initError key location (D.errorToString error)
@@ -255,8 +255,20 @@ changeRouteTo route model =
|> updateWith Mailbox MailboxMsg model
Route.Monitor ->
Monitor.init session
|> updateWith Monitor MonitorMsg model
if session.config.monitorVisible then
Monitor.init session
|> updateWith Monitor MonitorMsg model
else
let
flash =
{ title = "Unknown route requested"
, table = [ ( "Error", "Monitor disabled by configuration." ) ]
}
in
( applyToModelSession (Session.showFlash flash) model
, Cmd.none
)
Route.Status ->
Status.init session