mirror of
https://github.com/vale981/tridactyl
synced 2025-03-05 17:41:40 -05:00
Fix #2839: parse keys iff user config loaded
This commit is contained in:
parent
6d0810f2d5
commit
aa77f8d5aa
2 changed files with 4 additions and 1 deletions
|
@ -37,7 +37,7 @@ const CONFIGNAME = "userconfig"
|
||||||
/** @hidden */
|
/** @hidden */
|
||||||
const WAITERS = []
|
const WAITERS = []
|
||||||
/** @hidden */
|
/** @hidden */
|
||||||
let INITIALISED = false
|
export let INITIALISED = false
|
||||||
|
|
||||||
/** @hidden */
|
/** @hidden */
|
||||||
// make a naked object
|
// make a naked object
|
||||||
|
|
|
@ -418,6 +418,9 @@ export function translateKeysInPlace(keys, conf): void {
|
||||||
export function keyMap(conf): KeyMap {
|
export function keyMap(conf): KeyMap {
|
||||||
if (KEYMAP_CACHE[conf]) return KEYMAP_CACHE[conf]
|
if (KEYMAP_CACHE[conf]) return KEYMAP_CACHE[conf]
|
||||||
|
|
||||||
|
// Fail silently and pass keys through to page if Tridactyl hasn't loaded yet
|
||||||
|
if (!config.INITIALISED) return new Map()
|
||||||
|
|
||||||
const mapobj: { [keyseq: string]: string } = config.get(conf)
|
const mapobj: { [keyseq: string]: string } = config.get(conf)
|
||||||
if (mapobj === undefined)
|
if (mapobj === undefined)
|
||||||
throw new Error(
|
throw new Error(
|
||||||
|
|
Loading…
Add table
Reference in a new issue