diff --git a/src/components/UsageScriptModal.tsx b/src/components/UsageScriptModal.tsx index 19529f933..257a2333c 100644 --- a/src/components/UsageScriptModal.tsx +++ b/src/components/UsageScriptModal.tsx @@ -238,6 +238,7 @@ const UsageScriptModal: React.FC = ({ language: "javascript" as const, code: "", timeout: 10, + autoQueryInterval: 5, codingPlanProvider: autoDetected, }; } @@ -249,6 +250,7 @@ const UsageScriptModal: React.FC = ({ language: "javascript" as const, code: "", timeout: 10, + autoQueryInterval: 5, }; } @@ -257,6 +259,7 @@ const UsageScriptModal: React.FC = ({ language: "javascript" as const, code: PRESET_TEMPLATES[TEMPLATE_TYPES.GENERAL], timeout: 10, + autoQueryInterval: 5, }; }); @@ -1061,7 +1064,10 @@ const UsageScriptModal: React.FC = ({ onChange={(e) => setScript({ ...script, - timeout: validateTimeout(e.target.value), + timeout: + e.target.value === "" + ? (("" as unknown) as number) + : Number(e.target.value), }) } onBlur={(e) => @@ -1085,14 +1091,15 @@ const UsageScriptModal: React.FC = ({ min={0} max={1440} value={ - script.autoQueryInterval ?? script.autoIntervalMinutes ?? 0 + script.autoQueryInterval ?? script.autoIntervalMinutes ?? 5 } onChange={(e) => setScript({ ...script, - autoQueryInterval: validateAndClampInterval( - e.target.value, - ), + autoQueryInterval: + e.target.value === "" + ? (("" as unknown) as number) + : Number(e.target.value), }) } onBlur={(e) =>