Fix returning to specific catalog tab and removing a hotbar item (#5201)

* Fix removing hot bar item

Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Fix navigating back to tab in catalog from hotbar

Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
Janne SavolainenandMikko Aspiala authored and GitHub committed 2022-04-12 07:34:44 +03:00
1 parent c66f9ad407
commit 68a605ded9
2 files changed
+13 -8

No files matched your search

@@ -75,17 +75,17 @@ class NonInjectedHotbarMenu extends React.Component<Dependencies & HotbarMenuPro
this.props.hotbarStore.restackItems(from, to);
}
removeItem(uid: string) {
removeItem = (uid: string) => {
const hotbar = this.props.hotbarStore;
hotbar.removeFromHotbar(uid);
}
};
addItem(entity: CatalogEntity, index = -1) {
addItem = (entity: CatalogEntity, index = -1) => {
const hotbar = this.props.hotbarStore;
hotbar.addToHotbar(entity, index);
}
};
getMoveAwayDirection(entityId: string, cellIndex: number) {
const draggableItemIndex = this.hotbar.items.findIndex(item => item?.entity.uid == entityId);