aboutsummaryrefslogtreecommitdiffstats
path: root/webapp/src/app/@core-xds/services/sdk.service.ts
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2018-10-03 11:46:00 +0200
committerSebastien Douheret <sebastien.douheret@iot.bzh>2018-10-03 15:43:37 +0000
commitbd84d1a87793025d53694542334d3fc65c23d062 (patch)
tree16f07e98acc6689ea79aae43f869689817079b2d /webapp/src/app/@core-xds/services/sdk.service.ts
parent004779ae8a2831b2db38d2185a068ee9b34ab1f8 (diff)
Fixed 'Unknown sdkid' error in dashboard
Steps to reproduce problem: - open XDS dashboard, - display SDKs page list (click on SDKs in the left panel) - display Build page (click on Build in the left panel) - keep selected Project and SDK and just click on Build button - error 'Unknown sdkid' must be displayed Problem partially comes from the fact that default/current sdk in sdk.service is the first sdk and not the first Installed sdk. Change-Id: I21b9310e8ad67ff71afb5b704b39f5f98bc8707b Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh> (cherry picked from commit 319bdec474f655f415609c76a8e3b50b1d0b9aa4)
Diffstat (limited to 'webapp/src/app/@core-xds/services/sdk.service.ts')
-rw-r--r--webapp/src/app/@core-xds/services/sdk.service.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/webapp/src/app/@core-xds/services/sdk.service.ts b/webapp/src/app/@core-xds/services/sdk.service.ts
index f854744..f7e8c2f 100644
--- a/webapp/src/app/@core-xds/services/sdk.service.ts
+++ b/webapp/src/app/@core-xds/services/sdk.service.ts
@@ -103,7 +103,8 @@ export class SdkService {
// TODO: get previous val from xds-config service / cookie
if (this._sdksList.length > 0) {
- this.current = this._sdksList[0];
+ const installedSdks = this._sdksList.filter(sd => sd.status === StatusType.INSTALLED);
+ this.current = installedSdks.length > 0 ? installedSdks[0] : this._sdksList[0];
this.curSdkSubject.next(this.current);
}