the-via / app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Layer index is reset when a route change (Configure, Key Tester ect...)

yadomi opened this issue · comments

The layer index in the Configure tab is reset when navigating to another tab and going back to the Configure tab. This makes it cumbersome to quickly change a key and test it in the Key Tester.

The origin of the issue seems to come from this setLayer here:

dispatch(setLayer(0));

To reproduce the issue:

  1. Go to the Configure Tab
  2. Click on a layer in the Layer Control (e.g., pick layer 2)
  3. Go to any other tab (e.g.: pick Key Tester)
  4. Go back to the Configure tab
  5. ==> The layer is now reset to number 1

I'm not sure what the implication of the setLayer call in keyboard.tsx is and what it does in the first place (I've tried to blame/search in commit history for a lead, with no luck).

Let me know if a PR is welcomed to remove it.

#238 might be relevant to this issue