web: fix error message being a bit too persistent

visiting ?add=1 afresh was still showing the previous visit's error
This commit is contained in:
Simon Michael 2015-02-23 23:55:28 +00:00
parent abe47e81c2
commit d801eb1ab7
3 changed files with 3 additions and 2 deletions

View File

@ -105,6 +105,7 @@ instance Yesod App where
defaultLayout widget = do
master <- getYesod
lastmsg <- getMessage
vd@VD{..} <- getViewData
-- We break up the default layout into two components:

View File

@ -100,7 +100,7 @@ $newline never
<button type="button" .close data-dismiss="modal" aria-hidden="true">&times;
<h3 .modal-title #addLabel>Add a transaction
<div .modal-body>
$maybe m <- msg
$maybe m <- lastmsg
$if isPrefixOf "Errors" (renderHtml m)
<div #message>#{m}
^{addform staticRootUrl vd}

View File

@ -1,4 +1,4 @@
$maybe m <- msg
$maybe m <- lastmsg
$if not $ isPrefixOf "Errors" (renderHtml m)
<div #message>#{m}
^{widget}