Bug 1567622 - Initialise connection preferences dialog in the right order. r=Paenglab
--- a/mail/components/preferences/connection.js
+++ b/mail/components/preferences/connection.js
@@ -63,29 +63,29 @@ window.addEventListener("DOMContentLoade
() => gConnectionsDialog.readProxyProtocolPref("ssl", true));
Preferences.addSyncFromPrefListener(document.getElementById("networkProxySOCKS"),
() => gConnectionsDialog.readProxyProtocolPref("socks", false));
Preferences.addSyncFromPrefListener(document.getElementById("networkProxySOCKS_Port"),
() => gConnectionsDialog.readProxyProtocolPref("socks", true));
Preferences.addSyncFromPrefListener(document.getElementById("networkProxySOCKSVersion"),
() => gConnectionsDialog.updateDNSPref());
- let element = document.getElementById("networkDnsOverHttps");
- Preferences.addSyncFromPrefListener(element, () => gConnectionsDialog.readDnsOverHttpsMode());
- Preferences.addSyncToPrefListener(element, () => gConnectionsDialog.writeDnsOverHttpsMode());
-
// XXX: We can't init the DNS-over-HTTPs UI until the syncfrompref for network.trr.mode
// has been called. The uiReady promise will be resolved after the first call to
// readDnsOverHttpsMode and the subsequent call to initDnsOverHttpsUI has happened.
gConnectionsDialog.uiReady = new Promise(resolve => {
gConnectionsDialog._areTrrPrefsReady = false;
gConnectionsDialog._handleTrrPrefsReady = resolve;
}).then(() => {
gConnectionsDialog.initDnsOverHttpsUI();
});
+
+ let element = document.getElementById("networkDnsOverHttps");
+ Preferences.addSyncFromPrefListener(element, () => gConnectionsDialog.readDnsOverHttpsMode());
+ Preferences.addSyncToPrefListener(element, () => gConnectionsDialog.writeDnsOverHttpsMode());
}, { once: true, capture: true });
var gConnectionsDialog = {
beforeAccept() {
let dnsOverHttpsResolverChoice = document.getElementById("networkDnsOverHttpsResolverChoices").value;
if (dnsOverHttpsResolverChoice == "custom") {
let customValue = document.getElementById("networkCustomDnsOverHttpsInput").value.trim();
if (customValue) {