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: improve prompting when deleting variables #8529

Merged
merged 4 commits into from
Aug 19, 2024

Conversation

gonfunko
Copy link
Contributor

@gonfunko gonfunko commented Aug 14, 2024

The basics

The details

Resolves

This PR resolves several issues when deleting variables:

Proposed Changes

Blockly.Variables.deleteVariable() now takes an optional third argument, triggeringBlock, corresponding to the block that triggered the deletion, which is used to filter it out of the list of block references correctly when determining whether to prompt the user. Before, it simply assumed that if there was one reference that was the block that triggered the deletion, but deletion across the flyout/workspace boundary violated that assumption. For backwards compatibility, this arg is optional, and if not provided (legacy apps, or programmatic variable deletion) the old "warn if > 1 references" behavior is preserved.

@gonfunko gonfunko merged commit 14d119b into google:rc/v12.0.0 Aug 19, 2024
7 checks passed
@gonfunko gonfunko deleted the var-deletion branch August 19, 2024 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: fix Fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants