From 676b2c0e05bf9f7653b1a5dc5d5c62298a48173d Mon Sep 17 00:00:00 2001 From: Oleksii Orel Date: Tue, 6 Dec 2016 16:03:46 +0200 Subject: [PATCH] fixup! CHE-2919 improve process panel --- .../navbar/recent-workspaces/recent-workspaces.controller.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dashboard/src/app/navbar/recent-workspaces/recent-workspaces.controller.ts b/dashboard/src/app/navbar/recent-workspaces/recent-workspaces.controller.ts index 1b82c4645465..ea8caddc2e0c 100644 --- a/dashboard/src/app/navbar/recent-workspaces/recent-workspaces.controller.ts +++ b/dashboard/src/app/navbar/recent-workspaces/recent-workspaces.controller.ts @@ -136,8 +136,7 @@ export class NavbarRecentWorkspacesController { if (recentWorkspaces.length > MAX_RECENT_WORKSPACES_ITEMS) { let pos: number = veryRecentWorkspace ? recentWorkspaces.indexOf(veryRecentWorkspace) : -1; if (veryRecentWorkspace && pos >= MAX_RECENT_WORKSPACES_ITEMS) { - recentWorkspaces = recentWorkspaces.slice(0, MAX_RECENT_WORKSPACES_ITEMS - 1); - recentWorkspaces.push(veryRecentWorkspace); + recentWorkspaces.splice(MAX_RECENT_WORKSPACES_ITEMS - 1, recentWorkspaces.length , veryRecentWorkspace); } else { recentWorkspaces = recentWorkspaces.slice(0, MAX_RECENT_WORKSPACES_ITEMS); } @@ -180,7 +179,7 @@ export class NavbarRecentWorkspacesController { * @returns {boolean} */ isOpen(workspaceId: string): boolean { - return this.ideSvc && this.ideSvc.openedWorkspace && this.ideSvc.openedWorkspace.id === workspaceId; + return this.ideSvc.openedWorkspace && this.ideSvc.openedWorkspace.id === workspaceId; } /**