From 77a76a9e33bdde07825f070442919e27b216fb81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Thu, 29 Oct 2026 20:41:58 +0100 Subject: [PATCH] refactor(backup): keep the upload flow owned by the backups section The section that renders the recent-proof dialog is the one that hands the proof to each gated flow, which the recent-proof callers test reads from its source. The upload hook goes back there and the upload component takes the flow it returns. --- src/components/admin/backups-section.tsx | 4 +++- src/components/admin/backups/backup-upload-card.tsx | 13 +++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/components/admin/backups-section.tsx b/src/components/admin/backups-section.tsx index ba4f8fe63..7343904ea 100644 --- a/src/components/admin/backups-section.tsx +++ b/src/components/admin/backups-section.tsx @@ -30,6 +30,7 @@ import { RestoreJobStatus, visibleRestoreJobs } from "./backup-restore-status"; import { BackupRowsCards, BackupRowsTable } from "./backups/backup-rows"; import { DatabaseDumpRow } from "./backups/database-dump-row"; import { BackupUpload } from "./backups/backup-upload-card"; +import { useBackupUpload } from "./backups/use-backup-upload"; import { RestoreRefusalNotice, RestoreSkipReport, @@ -54,6 +55,7 @@ export function BackupsSection() { // a fresh proof unless this session signed in or re-proved within minutes. const recentProof = useRecentProof(); const { downloadingId, handleDownload } = useBackupDownload(recentProof); + const uploadFlow = useBackupUpload(recentProof); const { restoreJobs, dismissedRestores, @@ -123,7 +125,7 @@ export function BackupsSection() { ) : null} - + {visibleRestoreJobs(restoreJobs, dismissedRestores).map((job) => ( ; + flow: ReturnType; }) { const { upload, @@ -28,7 +25,7 @@ export function BackupUpload({ orphan, uploadInto, closeOrphan, - } = useBackupUpload(recentProof); + } = flow; return ( <>