Settings upgrade and schema fixes (#823)

* Add missing defaults

* Always include touch input during upgrade
This commit is contained in:
toasted-nutbread 2020-09-13 13:16:56 -04:00 committed by GitHub
parent a12c4a1dd7
commit b180ebc3bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 9 deletions

View File

@ -347,6 +347,12 @@
"mouse": true, "mouse": true,
"touch": false, "touch": false,
"pen": false "pen": false
},
"options": {
"showAdvanced": false,
"scanOnPenHover": true,
"scanOnPenPress": true,
"scanOnPenRelease": false
} }
}, },
{ {
@ -356,6 +362,12 @@
"mouse": false, "mouse": false,
"touch": true, "touch": true,
"pen": true "pen": true
},
"options": {
"showAdvanced": false,
"scanOnPenHover": true,
"scanOnPenPress": true,
"scanOnPenRelease": false
} }
} }
], ],

View File

@ -529,7 +529,7 @@ class OptionsUtil {
profileOptions.scanning.hideDelay = 0; profileOptions.scanning.hideDelay = 0;
profileOptions.scanning.pointerEventsEnabled = false; profileOptions.scanning.pointerEventsEnabled = false;
const {modifier, middleMouse, touchInputEnabled} = profileOptions.scanning; const {modifier, middleMouse} = profileOptions.scanning;
const scanningInputs = []; const scanningInputs = [];
let modifierInput = ''; let modifierInput = '';
switch (modifier) { switch (modifier) {
@ -557,14 +557,12 @@ class OptionsUtil {
options: createInputDefaultOptions() options: createInputDefaultOptions()
}); });
} }
if (touchInputEnabled) { scanningInputs.push({
scanningInputs.push({ include: '',
include: '', exclude: '',
exclude: '', types: {mouse: false, touch: true, pen: true},
types: {mouse: false, touch: true, pen: true}, options: createInputDefaultOptions()
options: createInputDefaultOptions() });
});
}
profileOptions.scanning.inputs = scanningInputs; profileOptions.scanning.inputs = scanningInputs;
} }
await this._addFieldTemplatesToOptions(options, '/bg/data/anki-field-templates-upgrade-v4.handlebars'); await this._addFieldTemplatesToOptions(options, '/bg/data/anki-field-templates-upgrade-v4.handlebars');