aboutsummaryrefslogtreecommitdiff
path: root/ext/js/pages/settings/settings-controller.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2024-01-31 08:38:30 -0500
committerGitHub <noreply@github.com>2024-01-31 13:38:30 +0000
commit87ed7c8affd3ade9d3cd2d9ed1a61dd5f224e473 (patch)
treebe727294e31ef21e8a3f634734610e69e4a155ac /ext/js/pages/settings/settings-controller.js
parent3e419aa562aab03ca20421aaf7e4d1a39194a5b4 (diff)
Module refactoring (#588)
* Convert PronunciationGenerator into static functions * Convert DictionaryDataUtil into static functions * Convert AnkiNoteDataCreator into static functions * Convert MediaUtil into static functions * Convert RegexUtil into static functions * Convert StringUtil into static functions * Convert ArrayBufferUtil into static functions * Convert AnkiUtil into static functions * Convert PermissionsUtil into static functions * Convert ProfileConditionsUtil into static functions
Diffstat (limited to 'ext/js/pages/settings/settings-controller.js')
-rw-r--r--ext/js/pages/settings/settings-controller.js11
1 files changed, 2 insertions, 9 deletions
diff --git a/ext/js/pages/settings/settings-controller.js b/ext/js/pages/settings/settings-controller.js
index 25f5e8ad..49fa9c9e 100644
--- a/ext/js/pages/settings/settings-controller.js
+++ b/ext/js/pages/settings/settings-controller.js
@@ -20,7 +20,7 @@ import {EventDispatcher} from '../../core/event-dispatcher.js';
import {EventListenerCollection} from '../../core/event-listener-collection.js';
import {generateId, isObject} from '../../core/utilities.js';
import {OptionsUtil} from '../../data/options-util.js';
-import {PermissionsUtil} from '../../data/permissions-util.js';
+import {getAllPermissions} from '../../data/permissions-util.js';
import {HtmlTemplateCollection} from '../../dom/html-template-collection.js';
import {yomitan} from '../../yomitan.js';
@@ -41,8 +41,6 @@ export class SettingsController extends EventDispatcher {
/** @type {HtmlTemplateCollection} */
this._templates = new HtmlTemplateCollection();
this._templates.load(document);
- /** @type {PermissionsUtil} */
- this._permissionsUtil = new PermissionsUtil();
}
/** @type {string} */
@@ -60,11 +58,6 @@ export class SettingsController extends EventDispatcher {
this._setProfileIndex(value, true);
}
- /** @type {PermissionsUtil} */
- get permissionsUtil() {
- return this._permissionsUtil;
- }
-
/** */
async prepare() {
yomitan.on('optionsUpdated', this._onOptionsUpdated.bind(this));
@@ -338,7 +331,7 @@ export class SettingsController extends EventDispatcher {
const eventName = 'permissionsChanged';
if (!this.hasListeners(eventName)) { return; }
- const permissions = await this._permissionsUtil.getAllPermissions();
+ const permissions = await getAllPermissions();
this.trigger(eventName, {permissions});
}