aboutsummaryrefslogtreecommitdiff
path: root/ext/bg
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-02-08 19:37:36 -0500
committerGitHub <noreply@github.com>2021-02-08 19:37:36 -0500
commit0ed24347ee275250bcd2c044a1b664f9f0273653 (patch)
treefedcc20ceceaa07834ec063a2331bcc815bc6c07 /ext/bg
parent0d031ab7856f7066b5fd950519c3654647ccdad6 (diff)
Fix settings permissions issues (#1360)
* Add missing warning indicator for the MeCab option * Fix error handling of permissions requests
Diffstat (limited to 'ext/bg')
-rw-r--r--ext/bg/js/settings/permissions-toggle-controller.js8
-rw-r--r--ext/bg/settings2.html1
2 files changed, 8 insertions, 1 deletions
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 @@
<div class="settings-item advanced-only">
<div class="settings-item-inner">
<div class="settings-item-left">
+ <div class="settings-item-invalid-indicator"></div>
<div class="settings-item-label">Parse text using <a href="https://en.wikipedia.org/wiki/MeCab" target="_blank" rel="noopener noreferrer">MeCab</a></div>
<div class="settings-item-description">
Requires a native component to be installed that Yomichan will connect to.