From eb839fcef9e8befad591cf35c00044adff9269f6 Mon Sep 17 00:00:00 2001 From: Aaron Dodson Date: Wed, 21 Aug 2024 14:02:57 -0700 Subject: [PATCH] fix: show the name of the list in the list getter block context menu (#132) --- blocks_vertical/data.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/blocks_vertical/data.js b/blocks_vertical/data.js index 7561156383..ea1e09edf1 100644 --- a/blocks_vertical/data.js +++ b/blocks_vertical/data.js @@ -596,7 +596,7 @@ const CUSTOM_CONTEXT_MENU_GET_LIST_MIXIN = { if (this.isCollapsed()) { return; } - var currentVarName = this.getField(fieldName).text_; + var currentVarName = this.getField(fieldName).getVariable().getName(); if (!this.isInFlyout) { var variablesList = this.workspace.getVariablesOfType( Constants.LIST_VARIABLE_TYPE @@ -683,8 +683,7 @@ const RENAME_OPTION_CALLBACK_FACTORY = function (block, fieldName) { */ const DELETE_OPTION_CALLBACK_FACTORY = function (block, fieldName) { return function () { - var workspace = block.workspace; - var variable = block.getField(fieldName).getVariable(); - workspace.deleteVariableById(variable.getId()); + const variable = block.getField(fieldName).getVariable(); + Blockly.Variables.deleteVariable(variable.getWorkspace(), variable, block); }; };