Disable backup export until passphrases match.

The download button stays inactive until both fields agree and meet
the minimum length, so users cannot start export with a mismatch.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-03 15:18:03 +02:00
co-authored by Cursor
parent 6f28ea0b16
commit 89f0f52841
+4 -1
View File
@@ -68,6 +68,9 @@ export default function LogbookBackupPanel({ logbookId, onRestored }: LogbookBac
const [error, setError] = useState<string | null>(null) const [error, setError] = useState<string | null>(null)
const [success, setSuccess] = useState<string | null>(null) const [success, setSuccess] = useState<string | null>(null)
const exportPassphrasesMatch =
exportPassphrase.length >= 8 && exportPassphrase === exportConfirm
const handleExportSubmit = async (e: React.FormEvent) => { const handleExportSubmit = async (e: React.FormEvent) => {
e.preventDefault() e.preventDefault()
await handleExport() await handleExport()
@@ -291,7 +294,7 @@ export default function LogbookBackupPanel({ logbookId, onRestored }: LogbookBac
<button <button
type="submit" type="submit"
className="btn primary" className="btn primary"
disabled={exporting || !exportPassphrase || !exportConfirm} disabled={exporting || !exportPassphrasesMatch}
> >
<Download size={16} /> <Download size={16} />
{exporting ? t('settings.backup_exporting') : t('settings.backup_export_btn')} {exporting ? t('settings.backup_exporting') : t('settings.backup_export_btn')}