diff options
author | Cashew <52880648+Scrub1492@users.noreply.github.com> | 2023-12-25 17:13:34 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-25 08:13:34 +0000 |
commit | bdaa77ff0d7c23f1594575ac22fb9693f1802b24 (patch) | |
tree | 87cef502658dfb1ba62434eef51f994a08ec5739 /ext/js/pages | |
parent | 89994427c7dfb25e7879948061a531f34cb1e9ab (diff) |
Narrow down enum types (#431)
* narrow down enum types
* add enum types
* change from default to case
* add enum types
* remove comments
* remove comments
* fix
* Move getErrorLevelValue to Logger
* Add enum type for LogErrorLevelValue
* add eslint switch-exhaustiveness-check rule
* Revert "add eslint switch-exhaustiveness-check"
This reverts commit 49f9caabf0af900bc5ba2b80f5baff72c27e02cd.
* move from labelled loop to helper functions
* move helper functions downward
Diffstat (limited to 'ext/js/pages')
-rw-r--r-- | ext/js/pages/settings/dictionary-import-controller.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/ext/js/pages/settings/dictionary-import-controller.js b/ext/js/pages/settings/dictionary-import-controller.js index c478b265..79a62d32 100644 --- a/ext/js/pages/settings/dictionary-import-controller.js +++ b/ext/js/pages/settings/dictionary-import-controller.js @@ -161,6 +161,7 @@ export class DictionaryImportController { }; let statusPrefix = ''; + /** @type {import('dictionary-importer.js').ImportStep} */ let stepIndex = -2; /** @type {import('dictionary-worker').ImportProgressCallback} */ const onProgress = (data) => { @@ -178,8 +179,8 @@ export class DictionaryImportController { for (const label of statusLabels) { label.textContent = statusString; } switch (stepIndex2) { - case -2: // Initialize - case 5: // Data import + case -2: + case 5: this._triggerStorageChanged(); break; } @@ -210,11 +211,12 @@ export class DictionaryImportController { } /** - * @param {number} stepIndex + * @param {import('dictionary-importer').ImportStep} stepIndex * @returns {string} */ _getImportLabel(stepIndex) { switch (stepIndex) { + case -2: return ''; case -1: case 0: return 'Loading dictionary'; case 1: return 'Loading schemas'; @@ -222,7 +224,6 @@ export class DictionaryImportController { case 3: return 'Formatting data'; case 4: return 'Importing media'; case 5: return 'Importing data'; - default: return ''; } } |