1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Fix removing hot bar item

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

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
Janne Savolainen 2022-04-06 10:01:19 +03:00
parent feb983c42c
commit a311355784
No known key found for this signature in database
GPG Key ID: 8C6CFB2FFFE8F68A

View File

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