Bug 1589848 - Don't try and update the separate private engine selector in preferences when the UI isn't shown. r=mak

Differential Revision: https://phabricator.services.mozilla.com/D49885

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Mark Banner 2019-10-21 10:14:30 +00:00
Родитель 6b4f9b67da
Коммит 411281f15f
1 изменённых файлов: 13 добавлений и 7 удалений

Просмотреть файл

@ -427,13 +427,19 @@ var gSearchPane = {
break;
}
case "engine-default-private": {
// If the user is going through the drop down using up/down keys, the
// dropdown may still be open (eg. on Windows) when engine-default is
// fired, so rebuilding the list unconditionally would get in the way.
const selectedEngine = document.getElementById("defaultPrivateEngine")
.selectedItem.engine;
if (selectedEngine.name != aEngine.name) {
gSearchPane.buildDefaultEngineDropDowns();
if (
this._separatePrivateDefaultEnabledPref.value &&
this._separatePrivateDefaultPref.value
) {
// If the user is going through the drop down using up/down keys, the
// dropdown may still be open (eg. on Windows) when engine-default is
// fired, so rebuilding the list unconditionally would get in the way.
const selectedEngine = document.getElementById(
"defaultPrivateEngine"
).selectedItem.engine;
if (selectedEngine.name != aEngine.name) {
gSearchPane.buildDefaultEngineDropDowns();
}
}
break;
}