cleanup daemonStatus accessors

This commit is contained in:
Joey Hess 2012-10-30 14:44:18 -04:00
parent 68118b8986
commit ea8df8fe9f
15 changed files with 29 additions and 29 deletions

View file

@ -10,6 +10,7 @@
module Assistant.WebApp.Configurators where
import Assistant.Common
import Assistant.DaemonStatus
import Assistant.WebApp
import Assistant.WebApp.Types
import Assistant.WebApp.SideBar
@ -101,7 +102,7 @@ repoList onlyconfigured includehere
where
configured = do
rs <- filter (not . Remote.readonly) . syncRemotes
<$> getDaemonStatusY
<$> runAssistantY getDaemonStatus
runAnnex [] $ do
u <- getUUID
let l = map Remote.uuid rs

View file

@ -27,7 +27,8 @@ sideBarDisplay :: Widget
sideBarDisplay = do
let content = do
{- Add newest alerts to the sidebar. -}
alertpairs <- lift $ M.toList . alertMap <$> getDaemonStatusY
alertpairs <- lift $ M.toList . alertMap
<$> runAssistantY getDaemonStatus
mapM_ renderalert $
take displayAlerts $ reverse $ sortAlertPairs alertpairs
let ident = "sidebar"
@ -79,7 +80,7 @@ getCloseAlert i = do
{- When an alert with a button is clicked on, the button takes us here. -}
getClickAlert :: AlertId -> Handler ()
getClickAlert i = do
m <- alertMap <$> getDaemonStatusY
m <- alertMap <$> runAssistantY getDaemonStatus
case M.lookup i m of
Just (Alert { alertButton = Just b }) -> do
{- Spawn a thread to run the action while redirecting. -}

View file

@ -44,7 +44,7 @@ changeSyncable (Just r) False = do
void $ liftIO $ dequeueTransfers (transferQueue d) dstatus tofrom
mapM_ (cancelTransfer False) =<<
filter tofrom . M.keys <$>
liftIO (currentTransfers <$> getDaemonStatus dstatus)
runAssistantY (currentTransfers <$> getDaemonStatus)
where
tofrom t = transferUUID t == Remote.uuid r
@ -128,4 +128,4 @@ startTransfer t = do
Transferrer.startTransfer program t info
getCurrentTransfers :: Handler TransferMap
getCurrentTransfers = currentTransfers <$> getDaemonStatusY
getCurrentTransfers = currentTransfers <$> runAssistantY getDaemonStatus