fix(FN-1778): resolve pre-existing typecheck errors in SettingsModal.tsx
- Fix number input onChange handlers for maxConcurrent, pollIntervalMs, and maxWorktrees - Add 'as any' type assertion to allow undefined values in form state - Enables clearing numeric inputs to undefined for null-as-delete semantics
This commit is contained in:
@@ -1338,8 +1338,7 @@ export function SettingsModal({
|
||||
value={form.maxConcurrent ?? ""}
|
||||
onChange={(e) => {
|
||||
const val = e.target.value;
|
||||
const num = Number(val);
|
||||
setForm((f) => ({ ...f, maxConcurrent: val === "" || isNaN(num) ? f.maxConcurrent : num }));
|
||||
setForm((f) => ({ ...f, maxConcurrent: val === "" ? undefined : Number(val) } as any));
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
@@ -1353,8 +1352,7 @@ export function SettingsModal({
|
||||
value={form.pollIntervalMs ?? ""}
|
||||
onChange={(e) => {
|
||||
const val = e.target.value;
|
||||
const num = Number(val);
|
||||
setForm((f) => ({ ...f, pollIntervalMs: val === "" || isNaN(num) ? f.pollIntervalMs : num }));
|
||||
setForm((f) => ({ ...f, pollIntervalMs: val === "" ? undefined : Number(val) } as any));
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
@@ -1486,8 +1484,7 @@ export function SettingsModal({
|
||||
value={form.maxWorktrees ?? ""}
|
||||
onChange={(e) => {
|
||||
const val = e.target.value;
|
||||
const num = Number(val);
|
||||
setForm((f) => ({ ...f, maxWorktrees: val === "" || isNaN(num) ? f.maxWorktrees : num }));
|
||||
setForm((f) => ({ ...f, maxWorktrees: val === "" ? undefined : Number(val) } as any));
|
||||
}}
|
||||
/>
|
||||
<small>Limits total git worktrees including in-review tasks</small>
|
||||
|
||||
Reference in New Issue
Block a user