Fix settings permissions issues (#1360)
* Add missing warning indicator for the MeCab option * Fix error handling of permissions requests
This commit is contained in:
parent
0d031ab785
commit
0ed24347ee
@ -71,10 +71,16 @@ class PermissionsToggleController {
|
|||||||
|
|
||||||
if (value || !hasPermissionsSetting) {
|
if (value || !hasPermissionsSetting) {
|
||||||
toggle.checked = valuePre;
|
toggle.checked = valuePre;
|
||||||
|
const requiredPermissions = this._getRequiredPermissions(toggle);
|
||||||
try {
|
try {
|
||||||
value = await this._settingsController.setPermissionsGranted(this._getRequiredPermissions(toggle), value);
|
value = await this._settingsController.setPermissionsGranted(requiredPermissions, value);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
value = valuePre;
|
value = valuePre;
|
||||||
|
try {
|
||||||
|
value = await this._settingsController.hasPermissions(requiredPermissions);
|
||||||
|
} catch (error2) {
|
||||||
|
// NOP
|
||||||
|
}
|
||||||
}
|
}
|
||||||
toggle.checked = value;
|
toggle.checked = value;
|
||||||
}
|
}
|
||||||
|
@ -1149,6 +1149,7 @@
|
|||||||
<div class="settings-item advanced-only">
|
<div class="settings-item advanced-only">
|
||||||
<div class="settings-item-inner">
|
<div class="settings-item-inner">
|
||||||
<div class="settings-item-left">
|
<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-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">
|
<div class="settings-item-description">
|
||||||
Requires a native component to be installed that Yomichan will connect to.
|
Requires a native component to be installed that Yomichan will connect to.
|
||||||
|
Loading…
Reference in New Issue
Block a user