Skip to content

Commit

Permalink
fix: increase default extension time (#2172)
Browse files Browse the repository at this point in the history
This does not fully close #2141, but builds upon #2171 to fulfill each
of the UX requests.

A next step (probably as a separate ticket) is to allow customizing
extension time pre-emptively.
  • Loading branch information
greyscaled committed Jun 8, 2022
1 parent b6899e2 commit b390250
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions site/src/util/workspace.test.ts
Expand Up @@ -47,7 +47,7 @@ describe("util > workspace", () => {
[
"2022-06-02T14:56:34Z",
{
deadline: "2022-06-02T16:26:34Z",
deadline: "2022-06-02T18:56:34Z",
},
],

Expand All @@ -56,7 +56,7 @@ describe("util > workspace", () => {
[
"2022-06-02T10:56:20-04:00",
{
deadline: "2022-06-02T16:26:20Z",
deadline: "2022-06-02T18:56:20Z",
},
],
])(`defaultWorkspaceExtension(%p) returns %p`, (startTime, request) => {
Expand Down
4 changes: 2 additions & 2 deletions site/src/util/workspace.ts
Expand Up @@ -251,10 +251,10 @@ export const isWorkspaceOn = (workspace: TypesGen.Workspace): boolean => {

export const defaultWorkspaceExtension = (__startDate?: dayjs.Dayjs): TypesGen.PutExtendWorkspaceRequest => {
const now = __startDate ? dayjs(__startDate) : dayjs()
const NinetyMinutesFromNow = now.add(90, "minutes").utc()
const fourHoursFromNow = now.add(4, "hours").utc()

return {
deadline: NinetyMinutesFromNow.format(),
deadline: fourHoursFromNow.format(),
}
}

Expand Down

0 comments on commit b390250

Please sign in to comment.