diff --git a/src/renderer/components/+catalog/catalog.tsx b/src/renderer/components/+catalog/catalog.tsx index 658c91273f..04d31bc95c 100644 --- a/src/renderer/components/+catalog/catalog.tsx +++ b/src/renderer/components/+catalog/catalog.tsx @@ -44,6 +44,7 @@ import { CatalogMenu } from "./catalog-menu"; import { HotbarIcon } from "../hotbar/hotbar-icon"; import { RenderDelay } from "../render-delay/render-delay"; import { TopBar } from "../layout/topbar"; +import { catalogEntityRegistry } from "../../api/catalog-entity-registry"; export const previousActiveTab = createAppStorage("catalog-previous-active-tab", ""); @@ -103,6 +104,19 @@ export class Catalog extends React.Component { } }, {fireImmediately: true}), ]); + this.setActiveEntity(); + } + + componentWillUnmount() { + this.removeActiveEntity(); + } + + setActiveEntity() { + catalogEntityRegistry.activeEntity = catalogEntityRegistry.getById("catalog-entity"); + } + + removeActiveEntity() { + catalogEntityRegistry.activeEntity = null; } addToHotbar(item: CatalogEntityItem): void {