diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2021-02-08 19:37:36 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-08 19:37:36 -0500 |
commit | 0ed24347ee275250bcd2c044a1b664f9f0273653 (patch) | |
tree | fedcc20ceceaa07834ec063a2331bcc815bc6c07 /ext/bg/js/settings/permissions-toggle-controller.js | |
parent | 0d031ab7856f7066b5fd950519c3654647ccdad6 (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/js/settings/permissions-toggle-controller.js')
-rw-r--r-- | ext/bg/js/settings/permissions-toggle-controller.js | 8 |
1 files changed, 7 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; } |