don't show "unknown" as the percent complete for transferinfo with no bytesComplete value
This commit is contained in:
parent
1296cfb09a
commit
19e8f1ca0e
1 changed files with 2 additions and 3 deletions
|
@ -61,9 +61,8 @@ readLcDirection "download" = Just Download
|
|||
readLcDirection _ = Nothing
|
||||
|
||||
percentComplete :: Transfer -> TransferInfo -> Maybe Percentage
|
||||
percentComplete (Transfer { transferKey = key }) (TransferInfo { bytesComplete = Just complete }) =
|
||||
(\size -> percentage size complete) <$> keySize key
|
||||
percentComplete _ _ = Nothing
|
||||
percentComplete (Transfer { transferKey = key }) info =
|
||||
percentage <$> keySize key <*> Just (fromMaybe 0 $ bytesComplete info)
|
||||
|
||||
upload :: UUID -> Key -> AssociatedFile -> Annex Bool -> Annex Bool
|
||||
upload u key file a = runTransfer (Transfer Upload u key) file a
|
||||
|
|
Loading…
Reference in a new issue