Add ability to rename hotbars (#3469)

Signed-off-by: vshakirova <vshakirova@mirantis.com>
This commit is contained in:
Violetta Shakirova authored and GitHub committed 2021-07-27 08:54:41 -04:00
1 parent f507ec9e6c
commit 1b11433bca
6 files changed
+147 -4

No files matched your search

+13
View File
@@ -153,6 +153,19 @@ export class HotbarStore extends BaseStore<HotbarStoreModel> {
}
}
@action
setHotbarName(id: string, name: string) {
const index = this.hotbars.findIndex((hotbar) => hotbar.id === id);
if(index < 0) {
console.warn(`[HOTBAR-STORE]: cannot setHotbarName: unknown id`, { id });
return;
}
this.hotbars[index].name = name;
}
@action
remove(hotbar: Hotbar) {
this.hotbars = this.hotbars.filter((h) => h !== hotbar);