Use ids in key actions instead of references (#239)
Partially reverts e48fdea
This commit is contained in:
@@ -59,7 +59,8 @@ export class KeymapTabComponent implements OnInit, OnChanges, Tab {
|
||||
}
|
||||
|
||||
const switchKeymapAction: SwitchKeymapAction = <SwitchKeymapAction>keyAction;
|
||||
this.selectedKeymap = switchKeymapAction.keymap;
|
||||
this.selectedKeymap = this.keymaps
|
||||
.find((keymap: Keymap) => keymap.abbreviation === switchKeymapAction.keymapAbbreviation);
|
||||
}
|
||||
|
||||
toKeyAction(): SwitchKeymapAction {
|
||||
@@ -68,7 +69,7 @@ export class KeymapTabComponent implements OnInit, OnChanges, Tab {
|
||||
}
|
||||
|
||||
const keymapAction = new SwitchKeymapAction();
|
||||
keymapAction.keymap = this.selectedKeymap;
|
||||
keymapAction.keymapAbbreviation = this.selectedKeymap.abbreviation;
|
||||
return keymapAction;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ export class MacroTabComponent implements OnInit, OnChanges, OnDestroy, Tab {
|
||||
return false;
|
||||
}
|
||||
const playMacroAction: PlayMacroAction = <PlayMacroAction>keyAction;
|
||||
this.selectedMacroIndex = this.macros.findIndex(macro => playMacroAction.macro === macro);
|
||||
this.selectedMacroIndex = this.macros.findIndex(macro => playMacroAction.macroId === macro.id);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ export class MacroTabComponent implements OnInit, OnChanges, OnDestroy, Tab {
|
||||
}
|
||||
|
||||
const keymapAction = new PlayMacroAction();
|
||||
keymapAction.macro = this.macros[this.selectedMacroIndex];
|
||||
keymapAction.macroId = this.macros[this.selectedMacroIndex].id;
|
||||
return keymapAction;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user