implement server-side alert closing

Rather than using bootstrap's client-side closing.
Now closed alerts stay closed.
This commit is contained in:
Joey Hess 2012-07-30 14:08:22 -04:00
parent 1f671ee40c
commit a994130843
5 changed files with 30 additions and 103 deletions

View file

@ -61,7 +61,7 @@ newDaemonStatus = DaemonStatus
<*> pure Nothing
<*> pure M.empty
<*> pure M.empty
<*> pure 0
<*> pure firstAlertId
<*> pure []
<*> newNotificationBroadcaster
<*> newNotificationBroadcaster
@ -217,7 +217,7 @@ addAlert dstatus alert = notifyAlert dstatus `after` modifyDaemonStatus dstatus
where
go s = (s { alertMax = i, alertMap = m }, i)
where
i = alertMax s + 1
i = nextAlertId $ alertMax s
m = M.insertWith' const i alert (alertMap s)
removeAlert :: DaemonStatusHandle -> AlertId -> IO ()