Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix closing saved workflows #1049

Merged
merged 3 commits into from
Sep 30, 2024
Merged

Fix closing saved workflows #1049

merged 3 commits into from
Sep 30, 2024

Conversation

christian-byrne
Copy link
Collaborator

During save of a new workflow:

// Saved new workflow, patch this instance
this.updatePath(path, null)
await this.manager.loadWorkflows()
this.unsaved = false

The ComfyWorkflow instance's path is updated then loadWorkflows is called. In loadWorkflows:

files.forEach((file: UserDataFullInfo) => {
let workflow = this.workflowLookup[file.path]
if (!workflow) {
workflow = new ComfyWorkflow(this, file.path, file.path.split('/'))
this.workflowLookup[workflow.path] = workflow

This if block triggers, since the ComfyWorkflow instance has not been remapped to its new path in workflowLookup. So a new instance is created instead of just patching and remapping the existing one. The new instance is closed by default so trying to close it in tab or sidebar does nothing.

Copy link
Member

@huchenlei huchenlei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for fixing this!

@huchenlei huchenlei merged commit 04e1344 into main Sep 30, 2024
9 checks passed
@huchenlei huchenlei deleted the wf-save branch September 30, 2024 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants