diff options
author | 2013-04-04 01:48:26 -0400 | |
---|---|---|
committer | 2013-04-04 01:48:26 -0400 | |
commit | 0d021ce388369f3f683f9c9c8d13b5c983b12ca3 (patch) | |
tree | dab67313491f4680ef0454f6396f6007d750511a /Assistant/Threads/PairListener.hs | |
parent | 8fb369aa5667f95d46b24f26b06636559155402b (diff) |
refactor alert button creation code
Diffstat (limited to 'Assistant/Threads/PairListener.hs')
-rw-r--r-- | Assistant/Threads/PairListener.hs | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/Assistant/Threads/PairListener.hs b/Assistant/Threads/PairListener.hs index 4459ee13c..cb9a94eff 100644 --- a/Assistant/Threads/PairListener.hs +++ b/Assistant/Threads/PairListener.hs @@ -11,7 +11,7 @@ import Assistant.Common import Assistant.Pairing import Assistant.Pairing.Network import Assistant.Pairing.MakeRemote -import Assistant.WebApp (UrlRenderer, renderUrl) +import Assistant.WebApp (UrlRenderer) import Assistant.WebApp.Types import Assistant.Alert import Assistant.DaemonStatus @@ -101,14 +101,8 @@ pairListenerThread urlrenderer = namedThread "PairListener" $ do pairReqReceived :: Bool -> UrlRenderer -> PairMsg -> Assistant () pairReqReceived True _ _ = noop -- ignore our own PairReq pairReqReceived False urlrenderer msg = do - url <- liftIO $ renderUrl urlrenderer (FinishLocalPairR msg) [] - closealert <- asIO1 removeAlert - void $ addAlert $ pairRequestReceivedAlert repo - AlertButton - { buttonUrl = url - , buttonLabel = T.pack "Respond" - , buttonAction = Just closealert - } + button <- mkAlertButton (T.pack "Respond") urlrenderer (FinishLocalPairR msg) + void $ addAlert $ pairRequestReceivedAlert repo button where repo = pairRepo msg |