cleanup daemonStatus accessors
This commit is contained in:
parent
68118b8986
commit
ea8df8fe9f
15 changed files with 29 additions and 29 deletions
|
@ -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
|
||||
|
|
|
@ -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. -}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue