Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

Commit

Permalink
Changed Serial.updatePortListStatus to make use of optional argument …
Browse files Browse the repository at this point in the history
…to eliminate updatePortListStatus(null) calls
  • Loading branch information
elektronikworkshop authored and adiazulay committed Jan 19, 2021
1 parent cdf9f34 commit deecdf2
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/serialmonitor/serialMonitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ export class SerialMonitor implements vscode.Disposable {
this._baudRateStatusBar.command = "arduino.changeBaudRate";
this._baudRateStatusBar.tooltip = "Baud Rate";
this._baudRateStatusBar.text = defaultBaudRate.toString();
this.updatePortListStatus(null);
this.updatePortListStatus();

const dc = DeviceContext.getInstance();
dc.onChangePort(() => {
this.updatePortListStatus(null);
this.updatePortListStatus();
});
}
public get initialized(): boolean {
Expand Down Expand Up @@ -210,8 +210,7 @@ export class SerialMonitor implements vscode.Disposable {
}
}

// TODO EW: use default value for port function parameter and change all updatePortListStatus(null) calls accordingly
private updatePortListStatus(port: string) {
private updatePortListStatus(port?: string) {
const dc = DeviceContext.getInstance();
if (port) {
dc.port = port;
Expand Down

0 comments on commit deecdf2

Please sign in to comment.