Fix ports status bar entry not updating with number

This commit is contained in:
Alex Ross
2020-10-14 16:39:14 +02:00
parent edd5e11cb0
commit dd72e8d03b

View File

@@ -99,8 +99,12 @@ export class ForwardedPortsView extends Disposable implements IWorkbenchContribu
}
private updateStatusBar() {
if (!this.entryAccessor && this.remoteExplorerService.tunnelModel.forwarded.size > 0) {
this._register(this.entryAccessor = this.statusbarService.addEntry(this.entry, 'status.forwardedPorts', nls.localize('status.forwardedPorts', "Forwarded Ports"), StatusbarAlignment.LEFT, 40));
if (this.remoteExplorerService.tunnelModel.forwarded.size > 0) {
if (!this.entryAccessor) {
this._register(this.entryAccessor = this.statusbarService.addEntry(this.entry, 'status.forwardedPorts', nls.localize('status.forwardedPorts', "Forwarded Ports"), StatusbarAlignment.LEFT, 40));
} else {
this.entryAccessor.update(this.entry);
}
} else if (this.entryAccessor && this.remoteExplorerService.tunnelModel.forwarded.size === 0) {
this.entryAccessor.dispose();
this.entryAccessor = undefined;