File tree 1 file changed +9
-2
lines changed
site/src/pages/WorkspaceSettingsPage/WorkspaceSchedulePage 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -428,7 +428,7 @@ export const WorkspaceScheduleForm: FC<WorkspaceScheduleFormProps> = ({
428
428
! template . allow_user_autostop ||
429
429
! form . values . autostopEnabled
430
430
}
431
- inputProps = { { min : 0 , step : "any" } }
431
+ inputProps = { { min : 0 , step : "any" , maxLength : 5 } }
432
432
label = { Language . ttlLabel }
433
433
type = "number"
434
434
fullWidth
@@ -452,10 +452,17 @@ export const ttlShutdownAt = (formTTL: number): string => {
452
452
if ( formTTL === 0 ) {
453
453
// Passing an empty value for TTL in the form results in a number that is not zero but less than 1.
454
454
return "Your workspace will not automatically shut down." ;
455
- } else {
455
+ }
456
+
457
+ try {
456
458
return `Your workspace will shut down ${ formatDuration (
457
459
intervalToDuration ( { start : 0 , end : formTTL * 60 * 60 * 1000 } ) ,
458
460
{ delimiter : " and " } ,
459
461
) } after its next start. We delay shutdown by 1 hour whenever we detect activity.`;
462
+ } catch ( e ) {
463
+ if ( e instanceof RangeError ) {
464
+ return Language . errorTtlMax ;
465
+ }
466
+ throw e ;
460
467
}
461
468
} ;
You can’t perform that action at this time.
0 commit comments