From 5cd83cfa2482f95c20d92a68ee01799f91fd3f3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Wed, 11 Oct 2023 22:19:11 +0200 Subject: [PATCH] Remove duplication MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- scripts/pi-hole/js/footer.js | 47 +++++++++++++++--------------------- 1 file changed, 20 insertions(+), 27 deletions(-) diff --git a/scripts/pi-hole/js/footer.js b/scripts/pi-hole/js/footer.js index 65cb4f29d..bdae70ee4 100644 --- a/scripts/pi-hole/js/footer.js +++ b/scripts/pi-hole/js/footer.js @@ -513,36 +513,29 @@ function updateVersionInfo() { ""; if (versionCompare(v.local, v.remote) === -1) { // Update available - $("#versions").append( - "
  • " + - v.name + - " " + - localVersion + - '· Update available!
  • ' - ); - } else { - $("#versions").append("
  • " + v.name + " " + localVersion + "
  • "); - } - } else { - // non-master branch - localVersion = "vDev (" + v.branch + ", " + v.hash + ")"; - if (v.hash != v.hash_remote) { - // hash differ > Update available - $("#versions").append( - "
  • " + - v.name + - " " + - localVersion + - '· Update available!
  • ' - ); + updateAvailable = true; } else { - $("#versions").append("
  • " + v.name + " " + localVersion + "
  • "); + // non-master branch + localVersion = "vDev (" + v.branch + ", " + v.hash + ")"; + if (v.hash != v.hash_remote) { + // hash differ > Update available + updateAvailable = true; + } } } + if (updateAvailable) { + $("#versions").append( + "
  • " + + v.name + + " " + + localVersion + + '· Update available!
  • ' + ); + } else { + $("#versions").append("
  • " + v.name + " " + localVersion + "
  • "); + } } });