Avoid useless reload if no actual change has happened in enforcement status.
This commit is contained in:
parent
f4141efc48
commit
59af507e1b
|
@ -178,6 +178,7 @@ addEventListener("unload", e => {
|
||||||
}, true);
|
}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let originallyEnforced = UI.policy.enforced;
|
||||||
let enforcementWarning = button => {
|
let enforcementWarning = button => {
|
||||||
if (button) {
|
if (button) {
|
||||||
let clone = button.cloneNode(true);
|
let clone = button.cloneNode(true);
|
||||||
|
@ -196,7 +197,8 @@ addEventListener("unload", e => {
|
||||||
this.disabled = true;
|
this.disabled = true;
|
||||||
policy.enforced = !pressed;
|
policy.enforced = !pressed;
|
||||||
await UI.updateSettings({policy, reloadAffected: false});
|
await UI.updateSettings({policy, reloadAffected: false});
|
||||||
if (policy.enforced || UI.local.immediateUnrestrict) {
|
if (policy.enforced !== originallyEnforced &&
|
||||||
|
(policy.enforced || UI.local.immediateUnrestrict)) {
|
||||||
reload();
|
reload();
|
||||||
close();
|
close();
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue