aboutsummaryrefslogtreecommitdiff
path: root/ext/bg
diff options
context:
space:
mode:
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.