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,
"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
}
}
],

View File

@ -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');