summaryrefslogtreecommitdiff
path: root/Assistant/Alert.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-09-09 01:02:44 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-09-09 01:02:44 -0400
commit1e41c0d85ecc24e8656bff79b2fba46c3663a054 (patch)
tree3fbd6316fed1de8866e0b8419c64ca4b821a9dde /Assistant/Alert.hs
parentf62cc484826991bfdb5469b8cf0b7b6b7a617e43 (diff)
update pair request alert when button is pressed
Diffstat (limited to 'Assistant/Alert.hs')
-rw-r--r--Assistant/Alert.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/Assistant/Alert.hs b/Assistant/Alert.hs
index 57674e2f3..f67de2402 100644
--- a/Assistant/Alert.hs
+++ b/Assistant/Alert.hs
@@ -53,9 +53,13 @@ data Alert = Alert
, alertButton :: Maybe AlertButton
}
+{- When clicked, a button always redirects to a URL
+ - It may also run an IO action in the background, which is useful
+ - to make the button close or otherwise change the alert. -}
data AlertButton = AlertButton
- { buttonUrl :: Text
- , buttonLabel :: Text
+ { buttonLabel :: Text
+ , buttonUrl :: Text
+ , buttonAction :: Maybe (AlertId -> IO ())
}
type AlertPair = (AlertId, Alert)