Bug 1744021 - force the update prefs to be disabled for at least one second when changing them, r=bytesized,preferences-reviewers,mstriemer
Differential Revision: https://phabricator.services.mozilla.com/D132959
This commit is contained in:
@@ -1765,6 +1765,7 @@ var gMainPane = {
|
||||
}
|
||||
},
|
||||
|
||||
_minDisableTime: 1000,
|
||||
/**
|
||||
* Selects the correct item in the update radio group
|
||||
*/
|
||||
@@ -1796,14 +1797,20 @@ var gMainPane = {
|
||||
) {
|
||||
let radiogroup = document.getElementById("updateRadioGroup");
|
||||
let updateAutoValue = radiogroup.value == "true";
|
||||
let _disableTimeOverPromise = new Promise(r =>
|
||||
setTimeout(r, this._minDisableTime)
|
||||
);
|
||||
radiogroup.disabled = true;
|
||||
try {
|
||||
await UpdateUtils.setAppUpdateAutoEnabled(updateAutoValue);
|
||||
await _disableTimeOverPromise;
|
||||
radiogroup.disabled = false;
|
||||
} catch (error) {
|
||||
Cu.reportError(error);
|
||||
await this.readUpdateAutoPref();
|
||||
await this.reportUpdatePrefWriteError(error);
|
||||
await Promise.all([
|
||||
this.readUpdateAutoPref(),
|
||||
this.reportUpdatePrefWriteError(error),
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user