Skip to content

Commit

Permalink
Progress API: Can't report 0 progress (fixes #46636)
Browse files Browse the repository at this point in the history
  • Loading branch information
bpasero committed Mar 27, 2018
1 parent d656cda commit 4831efe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -468,12 +468,12 @@ export class NotificationTemplateRenderer {
}

// Total / Worked
else if (state.total || state.worked) {
if (state.total) {
else if (typeof state.total === 'number' || typeof state.worked === 'number') {
if (typeof state.total === 'number') {
this.template.progress.total(state.total);
}

if (state.worked) {
if (typeof state.worked === 'number') {
this.template.progress.worked(state.worked).getContainer().show();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ export class ProgressService2 implements IProgressService2 {
};

const updateProgress = (notification: INotificationHandle, percentage?: number): void => {
if (typeof percentage === 'number' && percentage > 0) {
if (typeof percentage === 'number' && percentage >= 0) {
notification.progress.total(100); // always percentage based
notification.progress.worked(percentage);
} else {
Expand Down

0 comments on commit 4831efe

Please sign in to comment.