summaryrefslogtreecommitdiff
path: root/Assistant
diff options
context:
space:
mode:
Diffstat (limited to 'Assistant')
-rw-r--r--Assistant/WebApp/DashBoard.hs15
1 files changed, 7 insertions, 8 deletions
diff --git a/Assistant/WebApp/DashBoard.hs b/Assistant/WebApp/DashBoard.hs
index ffe967111..f9fad1bf6 100644
--- a/Assistant/WebApp/DashBoard.hs
+++ b/Assistant/WebApp/DashBoard.hs
@@ -209,16 +209,15 @@ cancelTransfer pause t = do
startTransfer :: Transfer -> Handler ()
startTransfer t = do
m <- getCurrentTransfers
- webapp <- getYesod
- let dstatus = daemonStatus webapp
- let q = transferQueue webapp
- {- resume a paused transfer -}
- maybe noop go (M.lookup t m)
- {- start a queued transfer -}
- is <- liftIO $ map snd <$> getMatchingTransfers q dstatus (== t)
- maybe noop start $ headMaybe is
+ maybe startqueued go (M.lookup t m)
where
go info = maybe (start info) (resume info) $ transferTid info
+ startqueued = do
+ webapp <- getYesod
+ let dstatus = daemonStatus webapp
+ let q = transferQueue webapp
+ is <- liftIO $ map snd <$> getMatchingTransfers q dstatus (== t)
+ maybe noop start $ headMaybe is
resume info tid = do
webapp <- getYesod
let dstatus = daemonStatus webapp