Add Image Path
[src/xds/xds-agent.git] / webapp / src / app / @core-xds / services / sdk.service.ts
index f854744..0ad5d0f 100644 (file)
@@ -51,6 +51,7 @@ export interface ISdk {
   arch: string;
   path: string;
   url: string;
+  image_url: string;
   status: string;
   date: string;
   size: string;
@@ -103,10 +104,10 @@ 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);
         }
-
         this.sdksSubject.next(this._sdksList);
       });
     });