From 0ed24347ee275250bcd2c044a1b664f9f0273653 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Mon, 8 Feb 2021 19:37:36 -0500 Subject: Fix settings permissions issues (#1360) * Add missing warning indicator for the MeCab option * Fix error handling of permissions requests --- ext/bg/js/settings/permissions-toggle-controller.js | 8 +++++++- ext/bg/settings2.html | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ext/bg/js/settings/permissions-toggle-controller.js b/ext/bg/js/settings/permissions-toggle-controller.js index 2e58ec67..04c8f3f2 100644 --- a/ext/bg/js/settings/permissions-toggle-controller.js +++ b/ext/bg/js/settings/permissions-toggle-controller.js @@ -71,10 +71,16 @@ class PermissionsToggleController { if (value || !hasPermissionsSetting) { toggle.checked = valuePre; + const requiredPermissions = this._getRequiredPermissions(toggle); try { - value = await this._settingsController.setPermissionsGranted(this._getRequiredPermissions(toggle), value); + value = await this._settingsController.setPermissionsGranted(requiredPermissions, value); } catch (error) { value = valuePre; + try { + value = await this._settingsController.hasPermissions(requiredPermissions); + } catch (error2) { + // NOP + } } toggle.checked = value; } diff --git a/ext/bg/settings2.html b/ext/bg/settings2.html index 341d7f21..41293a6e 100644 --- a/ext/bg/settings2.html +++ b/ext/bg/settings2.html @@ -1149,6 +1149,7 @@
+
Parse text using MeCab
Requires a native component to be installed that Yomichan will connect to. -- cgit v1.2.3