mirror of
https://github.com/thegeneralist01/archivr
synced 2026-07-21 18:55:36 +02:00
fix(frontend): guard handleArchive against Enter-key bypass of disabled state
The Archive button is disabled when anyConflict || anyProbing, but onKeyDown on the locator input calls onSubmit() → handleArchive() directly, bypassing the button's disabled check entirely. Add the same conditions as early returns inside handleArchive itself, operating on toSubmit (the items that would actually be submitted) so the guard is tight — items with no locator are already excluded by the toSubmit filter.
This commit is contained in:
parent
6eef53ee3a
commit
f096b052ab
3 changed files with 13 additions and 11 deletions
File diff suppressed because one or more lines are too long
|
|
@ -4,7 +4,7 @@
|
|||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Archivr</title>
|
||||
<script type="module" crossorigin src="/assets/index-C35zoxdh.js"></script>
|
||||
<script type="module" crossorigin src="/assets/index-CChk7xCp.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-vCRGeW0A.css">
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
|||
|
|
@ -382,6 +382,8 @@ export default function CaptureDialog({ open, archiveId, onClose, onCaptured, on
|
|||
function handleArchive() {
|
||||
const toSubmit = items.filter(it => it.locator.trim())
|
||||
if (toSubmit.length === 0) return
|
||||
if (toSubmit.some(it => hasConflict(it))) return
|
||||
if (toSubmit.some(it => it.playlistProbeState === 'probing' || it.probeState === 'probing')) return
|
||||
const batchId = toSubmit.length > 1
|
||||
? (crypto.randomUUID?.() ?? `batch-${Date.now()}`)
|
||||
: null
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue