ATL-1195: Show all libraries if no board selected.

Like for the examples, we show all libraries if no board is selected,
or the platform for the selected board is not installed.
Otherwise, we show the libs for the current board.

Signed-off-by: Akos Kitta <kittaakos@typefox.io>
This commit is contained in:
Akos Kitta 2021-04-07 11:58:18 +02:00 committed by Akos Kitta
parent 68af4c38fe
commit cb2ef78c0a

View File

@ -74,10 +74,9 @@ export class IncludeLibrary extends SketchContribution {
this.mainMenuManager.update();
const libraries: LibraryPackage[] = []
const fqbn = this.boardsServiceClient.boardsConfig.selectedBoard?.fqbn;
// Do not show board specific examples, when no board is selected.
if (fqbn) {
libraries.push(...await this.libraryService.list({ fqbn }));
}
// Show all libraries, when no board is selected.
// Otherwise, show libraries only for the selected board.
libraries.push(...await this.libraryService.list({ fqbn }));
const includeLibMenuPath = [...ArduinoMenus.SKETCH__UTILS_GROUP, '0_include'];
// `Add .ZIP Library...`