Wrapping HotbarStore.getInstance() into a function

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev committed 2021-10-11 11:19:25 +03:00
1 parent 2f1d32b47e
commit c5840e4293
1 file changed
+3 -1
@@ -102,7 +102,9 @@ export class CatalogEntityDrawerMenu<T extends CatalogEntity> extends React.Comp
);
}
if (!HotbarStore.getInstance().isAddedToActive(entity)) {
const isAddedEntity = () => HotbarStore.getInstance().isAddedToActive(entity);
if (!isAddedEntity) {
items.push(
<MenuItem key="add-to-hotbar" onClick={() => this.addToHotbar(entity) }>
<Icon material="push_pin" small tooltip="Add to Hotbar" />