mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-23 14:32:59 -05:00
Merge pull request #1871 from Affonso-Gui/fix_dynamic_menu_string
Fix dynamic menus for string arrays
This commit is contained in:
commit
a02fb3877b
1 changed files with 6 additions and 2 deletions
|
@ -320,13 +320,17 @@ class ExtensionManager {
|
|||
const menuItems = menuFunc.call(extensionObject, editingTargetID).map(
|
||||
item => {
|
||||
item = maybeFormatMessage(item, extensionMessageContext);
|
||||
if (typeof item === 'object') {
|
||||
switch (typeof item) {
|
||||
case 'object':
|
||||
return [
|
||||
maybeFormatMessage(item.text, extensionMessageContext),
|
||||
item.value
|
||||
];
|
||||
case 'string':
|
||||
return [item, item];
|
||||
default:
|
||||
return item;
|
||||
}
|
||||
return item;
|
||||
});
|
||||
|
||||
if (!menuItems || menuItems.length < 1) {
|
||||
|
|
Loading…
Reference in a new issue