summaryrefslogtreecommitdiff
path: root/ext/js/pages/settings/settings-controller.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/js/pages/settings/settings-controller.js')
-rw-r--r--ext/js/pages/settings/settings-controller.js12
1 files changed, 4 insertions, 8 deletions
diff --git a/ext/js/pages/settings/settings-controller.js b/ext/js/pages/settings/settings-controller.js
index 1b46c745..52b777a3 100644
--- a/ext/js/pages/settings/settings-controller.js
+++ b/ext/js/pages/settings/settings-controller.js
@@ -23,7 +23,7 @@ import {HtmlTemplateCollection} from '../../dom/html-template-collection.js';
import {yomitan} from '../../yomitan.js';
/**
- * @augments EventDispatcher<import('settings-controller').EventType>
+ * @augments EventDispatcher<import('settings-controller').Events>
*/
export class SettingsController extends EventDispatcher {
constructor() {
@@ -234,7 +234,7 @@ export class SettingsController extends EventDispatcher {
*/
_setProfileIndex(value, canUpdateProfileIndex) {
this._profileIndex = value;
- this.trigger('optionsContextChanged');
+ this.trigger('optionsContextChanged', {});
this._onOptionsUpdatedInternal(canUpdateProfileIndex);
}
@@ -253,9 +253,7 @@ export class SettingsController extends EventDispatcher {
const optionsContext = this.getOptionsContext();
try {
const options = await this.getOptions();
- /** @type {import('settings-controller').OptionsChangedEvent} */
- const event = {options, optionsContext};
- this.trigger('optionsChanged', event);
+ this.trigger('optionsChanged', {options, optionsContext});
} catch (e) {
if (canUpdateProfileIndex) {
this._setProfileIndex(0, false);
@@ -339,9 +337,7 @@ export class SettingsController extends EventDispatcher {
if (!this.hasListeners(eventName)) { return; }
const permissions = await this._permissionsUtil.getAllPermissions();
- /** @type {import('settings-controller').PermissionsChangedEvent} */
- const event = {permissions};
- this.trigger(eventName, event);
+ this.trigger(eventName, {permissions});
}
/**