Skip to content

Commit

Permalink
LayoutEditor: Fix two cases of using useCustom instead of onlyCustom
Browse files Browse the repository at this point in the history
Initially, the property was called `.useCustom`, but it was changed to
`.onlyCustom` when finalizing the names. When renaming, I missed two places,
which led to exceptionally bad behaviour.

This changes the remaining two cases too.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
  • Loading branch information
algernon committed Feb 4, 2019
1 parent 40b5d0e commit 3381a44
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/renderer/screens/LayoutEditor.js
Expand Up @@ -146,7 +146,7 @@ class LayoutEditor extends React.Component {
let layer = parseInt(this.state.currentLayer),
keyIndex = parseInt(this.state.currentKeyIndex);

if (this.state.keymap.useCustom) {
if (this.state.keymap.onlyCustom) {
if (layer < 0) {
layer += this.state.keymap.default.length;
return this.state.keymap.default[layer][keyIndex].keyCode;
Expand Down Expand Up @@ -174,7 +174,7 @@ class LayoutEditor extends React.Component {

this.setState(state => {
let keymap = state.keymap.custom.slice();
const l = state.keymap.useCustom
const l = state.keymap.onlyCustom
? layer
: layer - state.keymap.default.length;
keymap[l][keyIndex] = this.keymapDB.parse(keyCode);
Expand Down

0 comments on commit 3381a44

Please sign in to comment.