Skip to content

Commit

Permalink
Remove duplication
Browse files Browse the repository at this point in the history
Signed-off-by: Christian König <[email protected]>
  • Loading branch information
yubiuser committed Oct 11, 2023
1 parent d4d07f7 commit 5cd83cf
Showing 1 changed file with 20 additions and 27 deletions.
47 changes: 20 additions & 27 deletions scripts/pi-hole/js/footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -513,36 +513,29 @@ function updateVersionInfo() {
"</a>";
if (versionCompare(v.local, v.remote) === -1) {
// Update available
$("#versions").append(
"<li><strong>" +
v.name +
"</strong> " +
localVersion +
'&middot; <a class="lookatme" lookatme-text="Update available!" href="' +
v.url +
'" rel="noopener" target="_blank">Update available!</a></li>'
);
} else {
$("#versions").append("<li><strong>" + v.name + "</strong> " + localVersion + "</li>");
}
} else {
// non-master branch
localVersion = "vDev (" + v.branch + ", " + v.hash + ")";
if (v.hash != v.hash_remote) {
// hash differ > Update available
$("#versions").append(
"<li><strong>" +
v.name +
"</strong> " +
localVersion +
'&middot; <a class="lookatme" lookatme-text="Update available!" href="' +
v.url +
'" rel="noopener" target="_blank">Update available!</a></li>'
);
updateAvailable = true;
} else {
$("#versions").append("<li><strong>" + v.name + "</strong> " + localVersion + "</li>");
// non-master branch
localVersion = "vDev (" + v.branch + ", " + v.hash + ")";
if (v.hash != v.hash_remote) {

Check failure on line 520 in scripts/pi-hole/js/footer.js

View workflow job for this annotation

GitHub Actions / Node

Expected '!==' and instead saw '!='.
// hash differ > Update available
updateAvailable = true;
}
}
}
if (updateAvailable) {

Check failure on line 526 in scripts/pi-hole/js/footer.js

View workflow job for this annotation

GitHub Actions / Node

Expected blank line before this statement.
$("#versions").append(
"<li><strong>" +
v.name +
"</strong> " +
localVersion +
'&middot; <a class="lookatme" lookatme-text="Update available!" href="' +
v.url +
'" rel="noopener" target="_blank">Update available!</a></li>'
);
} else {
$("#versions").append("<li><strong>" + v.name + "</strong> " + localVersion + "</li>");
}
}
});

Expand Down

0 comments on commit 5cd83cf

Please sign in to comment.