fix(hook): fix race condition in progress dialog initialization

Initialize progress state before opening the execution report dialog to ensure the progress view displays correctly from the start.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
test
2026-03-07 17:26:57 +08:00
parent 2d6838c0e7
commit 310d5e462f

View File

@@ -315,8 +315,17 @@ export function useCleaner() {
}
setIsRunning(true)
// Initialize progress state BEFORE opening dialog to ensure progress view shows first
setProgress({
message: '正在初始化...',
progress: 0,
currentOrderIndex: 0,
totalOrders: 0,
currentMaterialIndex: 0,
totalMaterialsInOrder: 0,
phase: 'login'
})
setIsExecuting(true)
setProgress(null)
setStartTime(Date.now())
setIsReportDialogOpen(true)