fix(ui): prevent crashes when editing authentication priority

This commit is contained in:
lzt404 committed 2026-08-04 22:08:16 +08:00
1 parent 72bd0d5cfd
commit 759630294e
2 files changed
+8 -4

No files matched your search

+6 -3
View File
@@ -588,9 +588,12 @@ export function AuthFileManagementPage() {
placeholder={t('authFiles.priority.placeholder')}
disabled={busy}
aria-invalid={Boolean(priorityEditor.error)}
onChange={(event) => setPriorityEditor((current) => current
? { ...current, value: event.currentTarget.value, error: '' }
: current)}
onChange={(event) => {
const value = event.currentTarget.value;
setPriorityEditor((current) => current
? { ...current, value, error: '' }
: current);
}}
/>
<small>{t('authFiles.priority.hint')}</small>
</label>
+2 -1
View File
@@ -489,9 +489,10 @@ export function CodexSessionsPanel() {
type="checkbox"
checked={cleanupSelectedIds.has(candidate.id)}
onChange={(event) => {
const checked = event.currentTarget.checked;
setCleanupSelectedIds((current) => {
const next = new Set(current);
if (event.currentTarget.checked) next.add(candidate.id);
if (checked) next.add(candidate.id);
else next.delete(candidate.id);
return next;
});