Fix dynamic menus for string arrays

This commit is contained in:
Guilherme Affonso 2018-12-26 19:26:59 +09:00
parent c26eeaede7
commit f4c6816ea7

View file

@ -316,13 +316,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;
}
});
if (!menuItems || menuItems.length < 1) {