mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 06:52:40 -05:00
Fix dynamic menus for string arrays
This commit is contained in:
parent
c26eeaede7
commit
f4c6816ea7
1 changed files with 6 additions and 2 deletions
|
@ -316,13 +316,17 @@ class ExtensionManager {
|
||||||
const menuItems = menuFunc.call(extensionObject, editingTargetID).map(
|
const menuItems = menuFunc.call(extensionObject, editingTargetID).map(
|
||||||
item => {
|
item => {
|
||||||
item = maybeFormatMessage(item, extensionMessageContext);
|
item = maybeFormatMessage(item, extensionMessageContext);
|
||||||
if (typeof item === 'object') {
|
switch (typeof item) {
|
||||||
|
case 'object':
|
||||||
return [
|
return [
|
||||||
maybeFormatMessage(item.text, extensionMessageContext),
|
maybeFormatMessage(item.text, extensionMessageContext),
|
||||||
item.value
|
item.value
|
||||||
];
|
];
|
||||||
|
case 'string':
|
||||||
|
return [item, item];
|
||||||
|
default:
|
||||||
|
return item;
|
||||||
}
|
}
|
||||||
return item;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!menuItems || menuItems.length < 1) {
|
if (!menuItems || menuItems.length < 1) {
|
||||||
|
|
Loading…
Reference in a new issue