show one alert when bulk adding files

Turns out that a lot of the time spent in a bulk add was just updating the
add alert to rotate through each file that was added. Showing one alert
makes for a significant speedup.

Also, when the webapp is open, this makes it take quite a lot less cpu
during bulk adds.

Also, it lets the user know when a bulk add happened, which is sorta
nice..
This commit is contained in:
Joey Hess 2013-04-24 13:04:46 -04:00
parent 6e5c7520ff
commit a929e6641a
3 changed files with 32 additions and 18 deletions

View file

@ -233,7 +233,7 @@ fileAlert msg file = (activityAlert Nothing [f])
render fs = tenseWords $ msg : fs
combiner new old = take 10 $ new ++ old
addFileAlert :: FilePath -> Alert
addFileAlert :: String -> Alert
addFileAlert = fileAlert (Tensed "Adding" "Added")
{- This is only used as a success alert after a transfer, not during it. -}