mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-28 00:35:25 +08:00
fixed dynamic keymap legends and keymap mode next not working correctly together
closes #4366
This commit is contained in:
parent
9c2bcbd762
commit
3910349423
1 changed files with 10 additions and 5 deletions
|
@ -99,11 +99,16 @@ async function updateKeymapLegendCasing(): Promise<void> {
|
|||
const states = getLegendStates();
|
||||
if (states === undefined) return;
|
||||
|
||||
const keymapKeys = <HTMLElement[]>(
|
||||
[...document.getElementsByClassName("keymapKey")].filter(
|
||||
(el) => el.className === "keymapKey"
|
||||
)
|
||||
);
|
||||
const keymapKeys = <HTMLElement[]>[
|
||||
...document.getElementsByClassName("keymapKey"),
|
||||
].filter((el) => {
|
||||
const isKeymapKey = el.classList.contains("keymapKey");
|
||||
const isNotSpace =
|
||||
!el.classList.contains("keySpace") &&
|
||||
!el.classList.contains("keySplitSpace");
|
||||
|
||||
return isKeymapKey && isNotSpace;
|
||||
});
|
||||
|
||||
const layoutKeys = keymapKeys.map((el) => el.dataset["key"]);
|
||||
if (layoutKeys.includes(undefined)) return;
|
||||
|
|
Loading…
Reference in a new issue