From f3577e4b792ef98fe6a61b55757fe5b15375f5a6 Mon Sep 17 00:00:00 2001 From: Sven Efftinge Date: Fri, 3 Jun 2022 10:32:35 +0000 Subject: [PATCH] [dashboard] Treat today's workspaces as active --- components/dashboard/src/workspaces/workspace-model.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/dashboard/src/workspaces/workspace-model.ts b/components/dashboard/src/workspaces/workspace-model.ts index f08aecd929e62c..a56b5fd5a0e10e 100644 --- a/components/dashboard/src/workspaces/workspace-model.ts +++ b/components/dashboard/src/workspaces/workspace-model.ts @@ -145,8 +145,12 @@ export class WorkspaceModel implements Disposable, Partial { } protected isActive(info: WorkspaceInfo): boolean { + const lastSessionStart = WorkspaceInfo.lastActiveISODate(info); + const twentyfourHoursAgo = new Date(Date.now() - 1000 * 60 * 60 * 24).toISOString(); return ( - (info.workspace.pinned || (!!info.latestInstance && info.latestInstance.status?.phase !== "stopped")) && + (info.workspace.pinned || + (!!info.latestInstance && info.latestInstance.status?.phase !== "stopped") || + twentyfourHoursAgo.localeCompare(lastSessionStart) < 0) && !info.workspace.softDeleted ); }