Fix #2839: parse keys iff user config loaded

This commit is contained in:
Oliver Blanthorn 2020-09-24 14:25:59 +01:00
parent 6d0810f2d5
commit aa77f8d5aa
No known key found for this signature in database
GPG key ID: 2BB8C36BB504BFF3
2 changed files with 4 additions and 1 deletions

View file

@ -37,7 +37,7 @@ const CONFIGNAME = "userconfig"
/** @hidden */
const WAITERS = []
/** @hidden */
let INITIALISED = false
export let INITIALISED = false
/** @hidden */
// make a naked object

View file

@ -418,6 +418,9 @@ export function translateKeysInPlace(keys, conf): void {
export function keyMap(conf): KeyMap {
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)
if (mapobj === undefined)
throw new Error(