Add default keymap icon hint
This commit is contained in:
committed by
József Farkas
parent
8f930092df
commit
56c386bb7b
@@ -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;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user