Skip to content

Commit a78968e

Browse files
authored
Fix #261: only enable PROD options instead of disabling whole select elt (#262)
1 parent 2121a78 commit a78968e

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

extension/content/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
<h2>Options</h2>
1818
<select id="environment">
1919
<option value="custom"></option>
20-
<option value="prod">Prod</option>
21-
<option value="prod-preview">Prod (preview)</option>
20+
<option class="prod" value="prod">Prod</option>
21+
<option class="prod" value="prod-preview">Prod (preview)</option>
2222
<option value="stage">Stage</option>
2323
<option value="stage-preview">Stage (preview)</option>
2424
<option value="dev">Dev</option>

extension/content/script.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,10 @@ async function refreshUI(state) {
7979
document.getElementById("environment-error").style.display =
8080
serverSettingIgnored ? "block" : "none";
8181
if (serverSettingIgnored) {
82-
environmentElt.setAttribute("disabled", "disabled");
82+
// Disable all options except those related to prod
83+
environmentElt
84+
.querySelectorAll("option:not(.prod)")
85+
.forEach((optionElt) => optionElt.setAttribute("disabled", "disabled"));
8386
}
8487

8588
document.getElementById("polling-url").textContent = new URL(

0 commit comments

Comments
 (0)