From b180ebc3bc5182712fe33e5af3bea64b06204dcc Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sun, 13 Sep 2020 13:16:56 -0400 Subject: [PATCH] Settings upgrade and schema fixes (#823) * Add missing defaults * Always include touch input during upgrade --- ext/bg/data/options-schema.json | 12 ++++++++++++ ext/bg/js/options.js | 16 +++++++--------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/ext/bg/data/options-schema.json b/ext/bg/data/options-schema.json index 240305b5..0f310f6e 100644 --- a/ext/bg/data/options-schema.json +++ b/ext/bg/data/options-schema.json @@ -347,6 +347,12 @@ "mouse": true, "touch": false, "pen": false + }, + "options": { + "showAdvanced": false, + "scanOnPenHover": true, + "scanOnPenPress": true, + "scanOnPenRelease": false } }, { @@ -356,6 +362,12 @@ "mouse": false, "touch": true, "pen": true + }, + "options": { + "showAdvanced": false, + "scanOnPenHover": true, + "scanOnPenPress": true, + "scanOnPenRelease": false } } ], diff --git a/ext/bg/js/options.js b/ext/bg/js/options.js index 89538b3e..673666bb 100644 --- a/ext/bg/js/options.js +++ b/ext/bg/js/options.js @@ -529,7 +529,7 @@ class OptionsUtil { profileOptions.scanning.hideDelay = 0; profileOptions.scanning.pointerEventsEnabled = false; - const {modifier, middleMouse, touchInputEnabled} = profileOptions.scanning; + const {modifier, middleMouse} = profileOptions.scanning; const scanningInputs = []; let modifierInput = ''; switch (modifier) { @@ -557,14 +557,12 @@ class OptionsUtil { options: createInputDefaultOptions() }); } - if (touchInputEnabled) { - scanningInputs.push({ - include: '', - exclude: '', - types: {mouse: false, touch: true, pen: true}, - options: createInputDefaultOptions() - }); - } + scanningInputs.push({ + include: '', + exclude: '', + types: {mouse: false, touch: true, pen: true}, + options: createInputDefaultOptions() + }); profileOptions.scanning.inputs = scanningInputs; } await this._addFieldTemplatesToOptions(options, '/bg/data/anki-field-templates-upgrade-v4.handlebars');