Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit78c9f82

Browse files
fix(site): fix error when typing long number on ttl (#12249)
1 parent1d254f4 commit78c9f82

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

‎site/src/pages/WorkspaceSettingsPage/WorkspaceSchedulePage/WorkspaceScheduleForm.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ export const WorkspaceScheduleForm: FC<WorkspaceScheduleFormProps> = ({
428428
!template.allow_user_autostop||
429429
!form.values.autostopEnabled
430430
}
431-
inputProps={{min:0,step:"any"}}
431+
inputProps={{min:0,step:"any",maxLength:5}}
432432
label={Language.ttlLabel}
433433
type="number"
434434
fullWidth
@@ -452,10 +452,17 @@ export const ttlShutdownAt = (formTTL: number): string => {
452452
if(formTTL===0){
453453
// Passing an empty value for TTL in the form results in a number that is not zero but less than 1.
454454
return"Your workspace will not automatically shut down.";
455-
}else{
455+
}
456+
457+
try{
456458
return`Your workspace will shut down${formatDuration(
457459
intervalToDuration({start:0,end:formTTL*60*60*1000}),
458460
{delimiter:" and "},
459461
)} after its next start. We delay shutdown by 1 hour whenever we detect activity.`;
462+
}catch(e){
463+
if(einstanceofRangeError){
464+
returnLanguage.errorTtlMax;
465+
}
466+
throwe;
460467
}
461468
};

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp