From ba0762348d76f7e31c4d2144f295a2613a9273c1 Mon Sep 17 00:00:00 2001 From: Aaron Dodson Date: Wed, 21 Aug 2024 13:57:32 -0700 Subject: [PATCH] fix: display the correct variable reference count when deleting a variable. (#8549) --- core/variables.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/variables.ts b/core/variables.ts index bad87df0b..8c06a8d91 100644 --- a/core/variables.ts +++ b/core/variables.ts @@ -747,7 +747,13 @@ export function deleteVariable( if ((triggeringBlock && uses.length) || uses.length > 1) { // Confirm before deleting multiple blocks. const confirmText = Msg['DELETE_VARIABLE_CONFIRMATION'] - .replace('%1', String(uses.length + (triggeringBlock ? 1 : 0))) + .replace( + '%1', + String( + uses.length + + (triggeringBlock && !triggeringBlock.workspace.isFlyout ? 1 : 0), + ), + ) .replace('%2', variableName); dialog.confirm(confirmText, (ok) => { if (ok && variable) {