mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-11-12 11:49:27 +00:00
Show ports if has recognized board attached to it.
Closes #1365 - Ref:79ea0fa9a6- Ref:74bfdc4c56Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
This commit is contained in:
@@ -337,14 +337,9 @@ export class BoardsConfig extends React.Component<
|
||||
if (this.state.showAllPorts) {
|
||||
ports = this.state.knownPorts;
|
||||
} else {
|
||||
ports = this.state.knownPorts.filter((port) => {
|
||||
if (port.protocol === 'serial' || port.protocol === 'network') {
|
||||
// Allow all `serial` and `network` boards.
|
||||
// IDE2 must support better label for unrecognized `network` boards: https://github.com/arduino/arduino-ide/issues/1331
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
ports = this.state.knownPorts.filter(
|
||||
Port.visiblePorts(this.availableBoards)
|
||||
);
|
||||
}
|
||||
return !ports.length ? (
|
||||
<div className="loading noselect">
|
||||
|
||||
@@ -528,14 +528,9 @@ export class BoardsServiceProvider implements FrontendApplicationContribution {
|
||||
const currentAvailableBoards = this._availableBoards;
|
||||
const availableBoards: AvailableBoard[] = [];
|
||||
const attachedBoards = this._attachedBoards.filter(({ port }) => !!port);
|
||||
const availableBoardPorts = availablePorts.filter((port) => {
|
||||
if (port.protocol === 'serial' || port.protocol === 'network') {
|
||||
// Allow all `serial` and `network` boards.
|
||||
// IDE2 must support better label for unrecognized `network` boards: https://github.com/arduino/arduino-ide/issues/1331
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
const availableBoardPorts = availablePorts.filter(
|
||||
Port.visiblePorts(attachedBoards)
|
||||
);
|
||||
|
||||
for (const boardPort of availableBoardPorts) {
|
||||
const board = attachedBoards.find(({ port }) =>
|
||||
|
||||
Reference in New Issue
Block a user