mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Add ability to rename hotbars (#3469)
Signed-off-by: vshakirova <vshakirova@mirantis.com>
This commit is contained in:
1 parent
f507ec9e6c
commit
1b11433bca
6 files changed
+147
-4
No files matched your search
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user