Use undefined instead of -1 to indicate that there is no size yet

This commit is contained in:
Matt Bierner
2019-11-15 15:06:24 -08:00
parent d628c3b82e
commit 2dc8bac0a3
2 changed files with 8 additions and 4 deletions
@@ -51,10 +51,14 @@ export class BinarySizeStatusBarEntry extends Disposable {
}));
}
public show(owner: string, size: number) {
public show(owner: string, size: number | undefined) {
this._showingOwner = owner;
this._entry.text = size < 0 ? '' : BinarySize.formatSize(size);
this._entry.show();
if (typeof size === 'number') {
this._entry.text = BinarySize.formatSize(size);
this._entry.show();
} else {
this.hide(owner);
}
}
public hide(owner: string) {