From 96fd4921ec2119e75969a38979541354d08df0a1 Mon Sep 17 00:00:00 2001 From: Alex Andreev Date: Wed, 5 May 2021 11:58:43 +0300 Subject: [PATCH] Moving isActive check out of Droppable Signed-off-by: Alex Andreev --- src/renderer/components/hotbar/hotbar-menu.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/renderer/components/hotbar/hotbar-menu.tsx b/src/renderer/components/hotbar/hotbar-menu.tsx index 588ade7cd5..a9629b8934 100644 --- a/src/renderer/components/hotbar/hotbar-menu.tsx +++ b/src/renderer/components/hotbar/hotbar-menu.tsx @@ -57,6 +57,7 @@ export class HotbarMenu extends React.Component { renderGrid() { return this.hotbar.items.map((item, index) => { const entity = this.getEntity(item); + const isActive = !entity ? false : this.isActive(entity); return ( @@ -92,7 +93,7 @@ export class HotbarMenu extends React.Component { key={index} index={index} entity={entity} - isActive={this.isActive(entity)} + isActive={isActive} onClick={() => entity.onRun(catalogEntityRunContext)} className={cssNames({ isDragging: snapshot.isDragging })} />