... |
... |
@@ -99,6 +99,7 @@ const gConnectionPane = (function () { |
99
|
99
|
currentHeader: "#torPreferences-currentBridges-header",
|
100
|
100
|
currentDescription: "#torPreferences-currentBridges-description",
|
101
|
101
|
currentDescriptionText: "#torPreferences-currentBridges-descriptionText",
|
|
102
|
+ controls: "#torPreferences-currentBridges-controls",
|
102
|
103
|
switch: "#torPreferences-currentBridges-switch",
|
103
|
104
|
cards: "#torPreferences-currentBridges-cards",
|
104
|
105
|
cardTemplate: "#torPreferences-bridgeCard-template",
|
... |
... |
@@ -391,6 +392,7 @@ const gConnectionPane = (function () { |
391
|
392
|
selectors.bridges.currentHeader
|
392
|
393
|
);
|
393
|
394
|
bridgeHeader.textContent = TorStrings.settings.bridgeCurrent;
|
|
395
|
+ const bridgeControls = prefpane.querySelector(selectors.bridges.controls);
|
394
|
396
|
const bridgeSwitch = prefpane.querySelector(selectors.bridges.switch);
|
395
|
397
|
bridgeSwitch.setAttribute("label", TorStrings.settings.allBridgesEnabled);
|
396
|
398
|
bridgeSwitch.addEventListener("toggle", () => {
|
... |
... |
@@ -629,18 +631,17 @@ const gConnectionPane = (function () { |
629
|
631
|
|
630
|
632
|
const newStrings = new Set(TorSettings.bridges.bridge_strings);
|
631
|
633
|
const numBridges = newStrings.size;
|
632
|
|
- if (!newStrings.size) {
|
633
|
|
- bridgeHeader.hidden = true;
|
634
|
|
- bridgeDescription.hidden = true;
|
635
|
|
- bridgeCards.hidden = true;
|
|
634
|
+ const noBridges = !numBridges;
|
|
635
|
+ bridgeHeader.hidden = noBridges;
|
|
636
|
+ bridgeDescription.hidden = noBridges;
|
|
637
|
+ bridgeControls.hidden = noBridges;
|
|
638
|
+ bridgeCards.hidden = noBridges;
|
|
639
|
+ if (noBridges) {
|
636
|
640
|
showAll.hidden = true;
|
637
|
641
|
removeAll.hidden = true;
|
638
|
642
|
bridgeCards.textContent = "";
|
639
|
643
|
return;
|
640
|
644
|
}
|
641
|
|
- bridgeHeader.hidden = false;
|
642
|
|
- bridgeDescription.hidden = false;
|
643
|
|
- bridgeCards.hidden = false;
|
644
|
645
|
// Changing the pressed property on moz-toggle should not trigger its
|
645
|
646
|
// "toggle" event.
|
646
|
647
|
bridgeSwitch.pressed = TorSettings.bridges.enabled;
|
... |
... |
@@ -757,7 +758,7 @@ const gConnectionPane = (function () { |
757
|
758
|
bridge = provider.currentBridge;
|
758
|
759
|
} catch (e) {
|
759
|
760
|
console.warn("Could not get current bridge", e);
|
760
|
|
- }
|
|
761
|
+ }
|
761
|
762
|
if (bridge?.fingerprint !== this._currentBridgeId) {
|
762
|
763
|
this._currentBridgeId = bridge?.fingerprint ?? null;
|
763
|
764
|
this._updateConnectedBridges();
|