Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions scripts/js/settings-dns.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,16 @@ function fillDNSupstreams(value, servers) {

// Add event listener to checkboxes (shared across the Plain/DoT/DoH tabs)
$("input[id^='DNSupstreams-']").on("change", () => {
const upstreams = $("#DNSupstreamsTextfield").val().split("\n");
const upstreams = $("#DNSupstreamsTextfield").val().split(/\r?\n/u).filter(Boolean);
Comment thread
Copilot marked this conversation as resolved.
Outdated
let customServerCount = 0;
$("#DNSupstreamsTable input").each(function () {
$(
"#DNSupstreamsTable-plain input, #DNSupstreamsTable-dot input, #DNSupstreamsTable-doh input"
).each(function () {
Comment thread
yubiuser marked this conversation as resolved.
Outdated
const title = $(this).closest("td").attr("title");
if (!title) {
return;
}

if (this.checked && !upstreams.includes(title)) {
// Add server to array
upstreams.push(title);
Expand Down