mirror of
https://github.com/mas-cli/mas
synced 2024-11-29 06:50:39 +00:00
Don't show progress until we have a state
This commit is contained in:
parent
de1d921ba3
commit
111383fdb2
1 changed files with 9 additions and 5 deletions
|
@ -25,8 +25,8 @@ let csi = "\u{001B}["
|
|||
if status.failed || status.cancelled {
|
||||
queue.removeDownloadWithItemIdentifier(download.metadata.itemIdentifier)
|
||||
}
|
||||
else {
|
||||
progress(status.progressState)
|
||||
else if let state = status.progressState {
|
||||
progress(state)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -94,9 +94,13 @@ func clearLine() {
|
|||
}
|
||||
|
||||
extension SSDownloadStatus {
|
||||
var progressState: ProgressState {
|
||||
let phase = activePhase?.phaseDescription ?? "Waiting"
|
||||
return ProgressState(percentComplete: percentComplete, phase: phase)
|
||||
var progressState: ProgressState? {
|
||||
if let phase = activePhase {
|
||||
return ProgressState(percentComplete: percentComplete, phase: phase.phaseDescription)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue