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:
@@ -315,8 +315,17 @@ export function useCleaner() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setIsRunning(true)
|
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)
|
setIsExecuting(true)
|
||||||
setProgress(null)
|
|
||||||
setStartTime(Date.now())
|
setStartTime(Date.now())
|
||||||
setIsReportDialogOpen(true)
|
setIsReportDialogOpen(true)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user