Fixed the version ordering for libs.

Signed-off-by: Akos Kitta <kittaakos@typefox.io>
This commit is contained in:
Akos Kitta
2019-11-22 14:01:40 +01:00
parent 6448b447b3
commit f359843635
4 changed files with 10 additions and 9 deletions

View File

@@ -244,7 +244,7 @@ export class BoardsServiceImpl implements BoardsService {
const pkg = packages.get(id);
if (pkg) {
pkg.availableVersions.push(platform.getLatest());
pkg.availableVersions.sort(BoardPackage.VERSION_COMPARATOR);
pkg.availableVersions.sort(Installable.Version.COMPARATOR);
} else {
packages.set(id, toPackage(platform));
}

View File

@@ -47,7 +47,7 @@ export class LibraryServiceImpl implements LibraryService {
.slice(0, 50)
.map(item => {
// TODO: This seems to contain only the latest item instead of all of the items.
const availableVersions = item.getReleasesMap().getEntryList().map(([key, _]) => key);
const availableVersions = item.getReleasesMap().getEntryList().map(([key, _]) => key).sort(Installable.Version.COMPARATOR);
let installedVersion: string | undefined;
const installed = installedLibsIdx.get(item.getName());
if (installed) {