diff options
author | Cashew <52880648+Scrub1492@users.noreply.github.com> | 2023-12-20 21:36:27 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-20 12:36:27 +0000 |
commit | 229f04ba358b3485fa7952088e03dad9e651bb23 (patch) | |
tree | dfb4a0431368e2067d7e6f5d9ce08bf88e1730cd /ext/js/pages/settings/anki-controller.js | |
parent | 8b943cc97fab890085448122e7c13dd035d0e238 (diff) |
rename variables (#409)
* rename variables
* add comment to ambiguous variable
* rename variables
* add comments
* rename functions
Diffstat (limited to 'ext/js/pages/settings/anki-controller.js')
-rw-r--r-- | ext/js/pages/settings/anki-controller.js | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/ext/js/pages/settings/anki-controller.js b/ext/js/pages/settings/anki-controller.js index f470d9fa..6f357680 100644 --- a/ext/js/pages/settings/anki-controller.js +++ b/ext/js/pages/settings/anki-controller.js @@ -275,11 +275,13 @@ export class AnkiController { */ _onTestAnkiNoteViewerButtonClick(e) { const element = /** @type {HTMLElement} */ (e.currentTarget); + // Anki note GUI mode const {mode} = element.dataset; if (typeof mode !== 'string') { return; } - const mode2 = this._normalizeAnkiNoteGuiMode(mode); - if (mode2 === null) { return; } - this._testAnkiNoteViewerSafe(mode2); + + const normalizedMode = this._normalizeAnkiNoteGuiMode(mode); + if (normalizedMode === null) { return; } + this._testAnkiNoteViewerSafe(normalizedMode); } /** @@ -379,17 +381,17 @@ export class AnkiController { async _getAnkiData() { this._setAnkiStatusChanging(); const [ - [deckNames, error1], - [modelNames, error2] + [deckNames, getDeckNamesError], + [modelNames, getModelNamesError] ] = await Promise.all([ this._getDeckNames(), this._getModelNames() ]); - if (error1 !== null) { - this._showAnkiError(error1); - } else if (error2 !== null) { - this._showAnkiError(error2); + if (getDeckNamesError !== null) { + this._showAnkiError(getDeckNamesError); + } else if (getModelNamesError !== null) { + this._showAnkiError(getModelNamesError); } else { this._hideAnkiError(); } |