Skip to content

Commit

Permalink
[dashboard] Treat today's workspaces as active
Browse files Browse the repository at this point in the history
  • Loading branch information
svenefftinge committed Jun 9, 2022
1 parent 7bdf513 commit f3577e4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion components/dashboard/src/workspaces/workspace-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,12 @@ export class WorkspaceModel implements Disposable, Partial<GitpodClient> {
}

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
);
}
Expand Down

0 comments on commit f3577e4

Please sign in to comment.