aboutsummaryrefslogtreecommitdiff
path: root/ext/js/data
diff options
context:
space:
mode:
authorKuuuube <61125188+Kuuuube@users.noreply.github.com>2024-03-02 06:28:09 -0500
committerGitHub <noreply@github.com>2024-03-02 11:28:09 +0000
commit9577449e4bd2b7665e9161e50035393ef200205f (patch)
treed351e97ca87b1869216568ca03c9f19df5320697 /ext/js/data
parent98b11f794cd0fe828cc06d386e0b7126d5a387bb (diff)
Fix sentence-furigana template (#733)
Diffstat (limited to 'ext/js/data')
-rw-r--r--ext/js/data/options-util.js19
1 files changed, 15 insertions, 4 deletions
diff --git a/ext/js/data/options-util.js b/ext/js/data/options-util.js
index f2d085fe..cac2f82d 100644
--- a/ext/js/data/options-util.js
+++ b/ext/js/data/options-util.js
@@ -532,7 +532,8 @@ export class OptionsUtil {
this._updateVersion23,
this._updateVersion24,
this._updateVersion25,
- this._updateVersion26
+ this._updateVersion26,
+ this._updateVersion27
];
/* eslint-enable @typescript-eslint/unbound-method */
if (typeof targetVersion === 'number' && targetVersion < result.length) {
@@ -1156,9 +1157,11 @@ export class OptionsUtil {
*/
async _updateVersion25(options) {
for (const profile of options.profiles) {
- for (const hotkey of profile.options.inputs.hotkeys) {
- if (hotkey.action === 'viewNote') {
- hotkey.action = 'viewNotes';
+ if ('inputs' in profile.options && 'hotkeys' in profile.options.inputs) {
+ for (const hotkey of profile.options.inputs.hotkeys) {
+ if (hotkey.action === 'viewNote') {
+ hotkey.action = 'viewNotes';
+ }
}
}
}
@@ -1188,6 +1191,14 @@ export class OptionsUtil {
}
}
+ /**
+ * - Updated handlebars.
+ * @type {import('options-util').UpdateFunction}
+ */
+ async _updateVersion27(options) {
+ await this._applyAnkiFieldTemplatesPatch(options, '/data/templates/anki-field-templates-upgrade-v27.handlebars');
+ }
+
/**
* @param {string} url