Fix keymap deleting bug

This commit is contained in:
Farkas József
2016-12-15 23:42:20 +01:00
parent f4dd809a93
commit 31492da0a2
+2 -1
View File
@@ -97,11 +97,12 @@ export default function (state = initialState, action: Action): KeymapState {
filtered[0].isDefault = true; filtered[0].isDefault = true;
} }
const deletedKeymap = state.entities.find(keymap => keymap.abbreviation === action.payload);
// Check for the deleted keymap in other keymaps // Check for the deleted keymap in other keymaps
newState = filtered.map((keymap: Keymap) => { newState = filtered.map((keymap: Keymap) => {
changedKeymap = new Keymap(); changedKeymap = new Keymap();
Object.assign(changedKeymap, keymap); Object.assign(changedKeymap, keymap);
changedKeymap.layers = checkExistence(changedKeymap.layers, 'keymapAbbreviation', action.payload); changedKeymap.layers = checkExistence(changedKeymap.layers, 'keymap', deletedKeymap);
return changedKeymap; return changedKeymap;
}); });