summaryrefslogtreecommitdiff
path: root/ext/bg/js/settings/permissions-toggle-controller.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bg/js/settings/permissions-toggle-controller.js')
-rw-r--r--ext/bg/js/settings/permissions-toggle-controller.js8
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;
}