Skip to content

Commit

Permalink
fix change layer (qmk#408)
Browse files Browse the repository at this point in the history
* don't change layer if we are already on that layer
  - fixes crash when clicking twice on an empty layer
  • Loading branch information
zekth authored and yanfali committed Jun 11, 2019
1 parent 0a032fb commit c518a7c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/store/modules/keymap.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,9 @@ const mutations = {
state.dirty = false;
},
changeLayer(state, newLayer) {
if (newLayer === state.layer) {
return;
}
if (state.layer !== 0) {
// Only make a layer active if there are actual keys on it
const activeKeys = state.keymap[state.layer].filter(
Expand Down

0 comments on commit c518a7c

Please sign in to comment.