Navigate cluster context menus via broadcastMessage

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev committed 2021-10-26 10:51:20 +03:00
1 parent bbfb8372f3
commit 03177f3b14
1 file changed
+3 -1
+3 -1
View File
@@ -45,6 +45,8 @@ import { HotbarIcon } from "../hotbar/hotbar-icon";
import { makeObservable, observable } from "mobx"; import { makeObservable, observable } from "mobx";
import type { CatalogEntityContextMenuContext } from "../../../common/catalog"; import type { CatalogEntityContextMenuContext } from "../../../common/catalog";
import { HotbarStore } from "../../../common/hotbar-store"; import { HotbarStore } from "../../../common/hotbar-store";
import { broadcastMessage } from "../../../common/ipc";
import { IpcRendererNavigationEvents } from "../../navigation/events";
interface Props { interface Props {
className?: string; className?: string;
@@ -55,7 +57,7 @@ export class Sidebar extends React.Component<Props> {
static displayName = "Sidebar"; static displayName = "Sidebar";
@observable private contextMenu: CatalogEntityContextMenuContext = { @observable private contextMenu: CatalogEntityContextMenuContext = {
menuItems: [], menuItems: [],
navigate, navigate: (url: string) => broadcastMessage(IpcRendererNavigationEvents.NAVIGATE_IN_APP, url),
}; };
constructor(props: Props) { constructor(props: Props) {