Catalog & Hotbar - initial groundwork (#2418)

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Jari Kolehmainen authored and GitHub committed 2021-04-09 09:11:58 +03:00
1 parent e18a041b13
commit 99a464c61d
109 files changed
+1604 -2612

No files matched your search

+16
View File
@@ -16,10 +16,14 @@ import { LensProtocolRouterRenderer, bindProtocolAddRouteHandlers } from "./prot
import { registerIpcHandlers } from "./ipc";
import { ipcRenderer } from "electron";
import { IpcRendererNavigationEvents } from "./navigation/events";
import { catalogEntityRegistry } from "./api/catalog-entity-registry";
import { commandRegistry } from "../extensions/registries";
import { reaction } from "mobx";
@observer
export class LensApp extends React.Component {
static async init() {
catalogEntityRegistry.init();
extensionLoader.loadOnClusterManagerRenderer();
LensProtocolRouterRenderer.getInstance<LensProtocolRouterRenderer>().init();
bindProtocolAddRouteHandlers();
@@ -34,6 +38,18 @@ export class LensApp extends React.Component {
ipcRenderer.send(IpcRendererNavigationEvents.LOADED);
}
componentDidMount() {
reaction(() => catalogEntityRegistry.items, (items) => {
if (!commandRegistry.activeEntity) {
return;
}
if (!items.includes(commandRegistry.activeEntity)) {
commandRegistry.activeEntity = null;
}
});
}
render() {
return (
<Router history={history}>