Bug 1567622 - Initialise connection preferences dialog in the right order. r=Paenglab
authorGeoff Lankow <geoff@darktrojan.net>
Tue, 23 Jul 2019 12:52:10 +1200
changeset 35421 41c462c6bdfac1ffb4a4c2b2f2c7d042b3a312f7
parent 35420 f3489a1ec9f42b88c132c336c57c6e764161f0e3
child 35422 214434e7ca135ecfa37459478c3b6604a6e34ca7
push id2486
push userclokep@gmail.com
push dateMon, 02 Sep 2019 20:24:43 +0000
treeherdercomm-beta@1b30a9a6e7f6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersPaenglab
bugs1567622
Bug 1567622 - Initialise connection preferences dialog in the right order. r=Paenglab
mail/components/preferences/connection.js
--- 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) {