Fix access to the prefab editor by hiding the drop-down menu item (#6850)

This commit is contained in:
D8H
2024-08-06 11:47:49 +02:00
committed by GitHub
parent 2810056626
commit dd8c5dce2e

View File

@@ -16,6 +16,9 @@ import {
extensionObjectsRootFolderId,
} from '.';
import Add from '../UI/CustomSvgIcons/Add';
import Window from '../Utils/Window';
const isDev = Window.isDev();
const EVENTS_BASED_OBJECT_CLIPBOARD_KIND = 'Events Based Object';
@@ -143,11 +146,13 @@ export class EventsBasedObjectTreeViewItemContent
buildMenuTemplate(i18n: I18nType, index: number) {
return [
{
label: i18n._(t`Open visual editor`),
click: () =>
this.props.onOpenCustomObjectEditor(this.eventsBasedObject),
},
isDev
? {
label: i18n._(t`Open visual editor`),
click: () =>
this.props.onOpenCustomObjectEditor(this.eventsBasedObject),
}
: null,
{
label: i18n._(t`Add a function`),
click: () => this.addFunctionAtSelection(),
@@ -184,7 +189,7 @@ export class EventsBasedObjectTreeViewItemContent
click: () => this.paste(),
accelerator: 'CmdOrCtrl+V',
},
];
].filter(Boolean);
}
renderRightComponent(i18n: I18nType): ?React.Node {