aboutsummaryrefslogtreecommitdiff
path: root/ext/js/pages/welcome-main.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/js/pages/welcome-main.js')
-rw-r--r--ext/js/pages/welcome-main.js27
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);