mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 06:20:11 +00:00
fix: fallback to latest draft when saved workflow restore fails
Wrap openWorkflow in try/catch so a rejection falls through to the last-resort draft recovery instead of propagating to initializeWorkflow and loading a blank workflow. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -154,8 +154,15 @@ export function useWorkflowPersistenceV2() {
|
||||
// 2. No draft — try loading saved workflow by path
|
||||
const savedWorkflow = workflowStore.getWorkflowByPath(sessionPath)
|
||||
if (savedWorkflow) {
|
||||
await useWorkflowService().openWorkflow(savedWorkflow)
|
||||
return true
|
||||
try {
|
||||
await useWorkflowService().openWorkflow(savedWorkflow)
|
||||
return true
|
||||
} catch (err) {
|
||||
console.warn(
|
||||
'Failed to restore saved workflow, falling back to latest draft',
|
||||
err
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// 3. Last resort: most recent draft
|
||||
|
||||
Reference in New Issue
Block a user