Add default keymap icon hint

This commit is contained in:
Farkas József
2016-11-20 19:08:07 +01:00
committed by József Farkas
parent 8f930092df
commit 56c386bb7b
4 changed files with 24 additions and 5 deletions

View File

@@ -62,7 +62,12 @@ export default function(state = initialState, action: Action): KeymapState {
case KeymapActions.SET_DEFAULT:
newState = state.entities.map((keymap: Keymap) => {
keymap.isDefault = (keymap.abbreviation === action.payload);
if (keymap.abbreviation === action.payload || keymap.isDefault) {
let newKeymap: Keymap = new Keymap();
Object.assign(newKeymap, keymap);
keymap = newKeymap;
keymap.isDefault = keymap.abbreviation === action.payload;
}
return keymap;
});