diff options
author | 2012-07-30 14:08:22 -0400 | |
---|---|---|
committer | 2012-07-30 14:08:22 -0400 | |
commit | a9941308434354046fa51d3327c5e05ff080a247 (patch) | |
tree | 025bc566b43d01f6e41908ed635c467d168cb048 /Assistant/Alert.hs | |
parent | 1f671ee40c7f26d0adb16408ba1cf7fc9ceb3a7a (diff) |
implement server-side alert closing
Rather than using bootstrap's client-side closing.
Now closed alerts stay closed.
Diffstat (limited to 'Assistant/Alert.hs')
-rw-r--r-- | Assistant/Alert.hs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Assistant/Alert.hs b/Assistant/Alert.hs index 18f3ffa5d..4a3b2cf72 100644 --- a/Assistant/Alert.hs +++ b/Assistant/Alert.hs @@ -37,7 +37,15 @@ data Alert = Alert } {- Higher AlertId indicates a more recent alert. -} -type AlertId = Integer +newtype AlertId = AlertId Integer + deriving (Read, Show, Eq, Ord) + +{- Note: This first alert id is used for yesod's message. -} +firstAlertId :: AlertId +firstAlertId = AlertId 0 + +nextAlertId :: AlertId -> AlertId +nextAlertId (AlertId i) = AlertId $ succ i type AlertPair = (AlertId, Alert) |