diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2024-02-19 07:30:17 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-19 12:30:17 +0000 |
commit | 2da866f982930c76d2317a3be426410683ecf5a2 (patch) | |
tree | e77ce545177ba398068cb63037096a56dea04e2c /ext/js/pages/welcome-main.js | |
parent | 65fa65fc7765bc9a6557d3ce6f8bdcef5b5e0cf7 (diff) |
Update eslint rules (#710)
Diffstat (limited to 'ext/js/pages/welcome-main.js')
-rw-r--r-- | ext/js/pages/welcome-main.js | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/ext/js/pages/welcome-main.js b/ext/js/pages/welcome-main.js index d1d1a6b2..23511dd6 100644 --- a/ext/js/pages/welcome-main.js +++ b/ext/js/pages/welcome-main.js @@ -49,6 +49,15 @@ async function setupGenericSettingsController(genericSettingController) { await genericSettingController.refresh(); } +/** */ +async function checkNeedsCustomTemplatesWarning() { + const key = 'needsCustomTemplatesWarning'; + const result = await chrome.storage.session.get({[key]: false}); + if (!result[key]) { return; } + document.documentElement.dataset.warnCustomTemplates = 'true'; + await chrome.storage.session.remove([key]); +} + await Application.main(true, async (application) => { const documentFocusController = new DocumentFocusController(); documentFocusController.prepare(); @@ -61,14 +70,8 @@ await Application.main(true, async (application) => { const statusFooter = new StatusFooter(statusFooterElement); statusFooter.prepare(); - setupEnvironmentInfo(application.api); - - chrome.storage.session.get({needsCustomTemplatesWarning: false}).then((result) => { - if (result.needsCustomTemplatesWarning) { - document.documentElement.dataset.warnCustomTemplates = 'true'; - chrome.storage.session.remove(['needsCustomTemplatesWarning']); - } - }); + void setupEnvironmentInfo(application.api); + void checkNeedsCustomTemplatesWarning(); const preparePromises = []; @@ -79,19 +82,19 @@ await Application.main(true, async (application) => { await settingsController.prepare(); const dictionaryController = new DictionaryController(settingsController, modalController, statusFooter); - dictionaryController.prepare(); + preparePromises.push(dictionaryController.prepare()); const dictionaryImportController = new DictionaryImportController(settingsController, modalController, statusFooter); - dictionaryImportController.prepare(); + preparePromises.push(dictionaryImportController.prepare()); const genericSettingController = new GenericSettingController(settingsController); preparePromises.push(setupGenericSettingsController(genericSettingController)); const simpleScanningInputController = new ScanInputsSimpleController(settingsController); - simpleScanningInputController.prepare(); + preparePromises.push(simpleScanningInputController.prepare()); const recommendedPermissionsController = new RecommendedPermissionsController(settingsController); - recommendedPermissionsController.prepare(); + preparePromises.push(recommendedPermissionsController.prepare()); await Promise.all(preparePromises); |