Skip to content

Commit 338aa4b

Browse files
authored
fix: set key color of uninitialised NoneAction (#2350)
1 parent 919269e commit 338aa4b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/uhk-web/src/app/store/reducers/user-configuration.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,11 @@ export function reducer(
401401

402402
module = new Module(module);
403403
const selectedColor = state.backlightingColorPalette[state.selectedBacklightingColorIndex];
404-
const keyAction = KeyActionHelper.fromKeyAction(module.keyActions[payload.key]);
404+
let keyAction = KeyActionHelper.fromKeyAction(module.keyActions[payload.key]);
405+
if (!keyAction) {
406+
keyAction = new NoneAction();
407+
}
408+
405409
keyAction.b = selectedColor.b;
406410
keyAction.g = selectedColor.g;
407411
keyAction.r = selectedColor.r;

0 commit comments

Comments
 (0)