diff --git a/front-end/app/studio/pages/dashboard/dashboard.page.html b/front-end/app/studio/pages/dashboard/dashboard.page.html
index 2776eae7b..a707fb353 100644
--- a/front-end/app/studio/pages/dashboard/dashboard.page.html
+++ b/front-end/app/studio/pages/dashboard/dashboard.page.html
@@ -36,8 +36,9 @@
No APIs Found
- We couldn't find any APIs for you - it's likely that you have not yet created/added any APIs to the studio.
- Not to worry, we can do that now!
+ We couldn't find any APIs for you - it's possible that you have not yet created/added any APIs to the studio.
+ Or perhaps you have some APIs but haven't worked on them recently. Pick an action below that makes sense
+ for you!
diff --git a/front-end/app/studio/services/apis-hub.service.ts b/front-end/app/studio/services/apis-hub.service.ts
index 5f6c4f811..23ba26b86 100644
--- a/front-end/app/studio/services/apis-hub.service.ts
+++ b/front-end/app/studio/services/apis-hub.service.ts
@@ -94,6 +94,7 @@ export class HubApisService implements IApisService {
this.theRecentApis = this.getRecentFromAllApis(apis);
this._recentApis.next(this.theRecentApis);
}
+ this.removeMissingRecentApis(apis);
return apis;
}).toPromise();
}
@@ -471,4 +472,24 @@ export class HubApisService implements IApisService {
this.theRecentApis = recent;
return recent;
}
+
+ /**
+ * Removes any API from the "recent APIs" list that is not in the
+ * given list of "all" Apis.
+ * @param apis
+ */
+ private removeMissingRecentApis(apis: Api[]) {
+ this.theRecentApis.filter( recentApi => {
+ let found: boolean = false;
+ apis.forEach( api => {
+ if (api.id === recentApi.id) {
+ found = true;
+ }
+ });
+ return !found;
+ }).forEach( diffApi => {
+ console.info("[HubApisService] Removing '%s' from the recent APIs list.", diffApi.name);
+ this.theRecentApis.splice(this.theRecentApis.indexOf(diffApi), 1);
+ });
+ }
}