aboutsummaryrefslogtreecommitdiff
path: root/ext/js/pages/settings/backup-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/backup-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/backup-controller.js')
-rw-r--r--ext/js/pages/settings/backup-controller.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/ext/js/pages/settings/backup-controller.js b/ext/js/pages/settings/backup-controller.js
index f2eccd1e..053cc96b 100644
--- a/ext/js/pages/settings/backup-controller.js
+++ b/ext/js/pages/settings/backup-controller.js
@@ -22,7 +22,8 @@ import {log} from '../../core/logger.js';
import {toError} from '../../core/to-error.js';
import {isObject} from '../../core/utilities.js';
import {OptionsUtil} from '../../data/options-util.js';
-import {ArrayBufferUtil} from '../../data/sandbox/array-buffer-util.js';
+import {getAllPermissions} from '../../data/permissions-util.js';
+import {arrayBufferUtf8Decode} from '../../data/sandbox/array-buffer-util.js';
import {querySelectorNotNull} from '../../dom/query-selector.js';
import {yomitan} from '../../yomitan.js';
import {DictionaryController} from './dictionary-controller.js';
@@ -135,7 +136,7 @@ export class BackupController {
const optionsFull = await this._settingsController.getOptionsFull();
const environment = await yomitan.api.getEnvironmentInfo();
const fieldTemplatesDefault = await yomitan.api.getDefaultAnkiFieldTemplates();
- const permissions = await this._settingsController.permissionsUtil.getAllPermissions();
+ const permissions = await getAllPermissions();
// Format options
for (const {options} of optionsFull.profiles) {
@@ -425,7 +426,7 @@ export class BackupController {
async _importSettingsFile(file) {
if (this._optionsUtil === null) { throw new Error('OptionsUtil invalid'); }
- const dataString = ArrayBufferUtil.arrayBufferUtf8Decode(await this._readFileArrayBuffer(file));
+ const dataString = arrayBufferUtf8Decode(await this._readFileArrayBuffer(file));
/** @type {import('backup-controller').BackupData} */
const data = parseJson(dataString);