Update state when graph cleared via UI #88
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ChangeTracker
is not tracking the graph being cleared via the clear-workflow buttons in the UI. Probably because clicks on the alert dialog don't trigger a state check. This is another iteration of this issue.Here's the situation that can result from this:
In reality, the user would just need to do something else that would trigger a state check. But on first attempt, it will fail.
This change solves the issue by dispatching a
graphCleared
event to the api when the clear-workflow button is clicked in the old or new menu, and hasChangeTracker
listen for that event.I think it's maybe an unusual thing for the
api
to serve as the observer for such a thing, but that seems to be the pattern right now until there's a more clear dilineation that separates the event systems.