aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/settings
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-07-18 17:11:38 -0400
committerGitHub <noreply@github.com>2020-07-18 17:11:38 -0400
commitd7f78c23b50218eaa52ab4570a1e2297c52c287e (patch)
tree64a217ccc1f96efeec3c81e1d16215963536c733 /ext/bg/js/settings
parente696dc84a857e60adcfa7feec44398765c430cac (diff)
Script ready state change (#672)
* Update how backend/frontend ready states are awaited and signaled * Log errors on the search page * Update action name
Diffstat (limited to 'ext/bg/js/settings')
-rw-r--r--ext/bg/js/settings/main.js62
1 files changed, 34 insertions, 28 deletions
diff --git a/ext/bg/js/settings/main.js b/ext/bg/js/settings/main.js
index 48b72735..db371d37 100644
--- a/ext/bg/js/settings/main.js
+++ b/ext/bg/js/settings/main.js
@@ -63,45 +63,51 @@ async function setupEnvironmentInfo() {
(async () => {
- api.forwardLogsToBackend();
- await yomichan.ready();
+ try {
+ api.forwardLogsToBackend();
+ await yomichan.backendReady();
- setupEnvironmentInfo();
- showExtensionInformation();
- settingsPopulateModifierKeys();
+ setupEnvironmentInfo();
+ showExtensionInformation();
+ settingsPopulateModifierKeys();
- const optionsFull = await api.optionsGetFull();
+ const optionsFull = await api.optionsGetFull();
- const settingsController = new SettingsController(optionsFull.profileCurrent);
- settingsController.prepare();
+ const settingsController = new SettingsController(optionsFull.profileCurrent);
+ settingsController.prepare();
- const storageController = new StorageController();
- storageController.prepare();
+ const storageController = new StorageController();
+ storageController.prepare();
- const genericSettingController = new GenericSettingController(settingsController);
- genericSettingController.prepare();
+ const genericSettingController = new GenericSettingController(settingsController);
+ genericSettingController.prepare();
- const clipboardPopupsController = new ClipboardPopupsController(settingsController);
- clipboardPopupsController.prepare();
+ const clipboardPopupsController = new ClipboardPopupsController(settingsController);
+ clipboardPopupsController.prepare();
- const popupPreviewController = new PopupPreviewController(settingsController);
- popupPreviewController.prepare();
+ const popupPreviewController = new PopupPreviewController(settingsController);
+ popupPreviewController.prepare();
- const audioController = new AudioController(settingsController);
- audioController.prepare();
+ const audioController = new AudioController(settingsController);
+ audioController.prepare();
- const profileController = new ProfileController(settingsController);
- profileController.prepare();
+ const profileController = new ProfileController(settingsController);
+ profileController.prepare();
- const dictionaryController = new DictionaryController(settingsController, storageController);
- dictionaryController.prepare();
+ const dictionaryController = new DictionaryController(settingsController, storageController);
+ dictionaryController.prepare();
- const ankiController = new AnkiController(settingsController);
- ankiController.prepare();
+ const ankiController = new AnkiController(settingsController);
+ ankiController.prepare();
- const ankiTemplatesController = new AnkiTemplatesController(settingsController, ankiController);
- ankiTemplatesController.prepare();
+ const ankiTemplatesController = new AnkiTemplatesController(settingsController, ankiController);
+ ankiTemplatesController.prepare();
- const settingsBackup = new SettingsBackup(settingsController);
- settingsBackup.prepare();
+ const settingsBackup = new SettingsBackup(settingsController);
+ settingsBackup.prepare();
+
+ yomichan.ready();
+ } catch (e) {
+ yomichan.logError(e);
+ }
})();