From 5d411e8985e2813955059dbe1183293fbadc7d62 Mon Sep 17 00:00:00 2001 From: Joseph Rollins Date: Wed, 26 Apr 2023 09:23:48 -0700 Subject: [PATCH] Fix tab navigation --- changedetectionio/static/js/tabs.js | 3 ++- changedetectionio/templates/watch-overview.html | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/changedetectionio/static/js/tabs.js b/changedetectionio/static/js/tabs.js index c419e0fbf..aeb427fee 100644 --- a/changedetectionio/static/js/tabs.js +++ b/changedetectionio/static/js/tabs.js @@ -12,7 +12,8 @@ window.addEventListener('hashchange', function () { var has_errors = document.querySelectorAll(".messages .error"); if (!has_errors.length) { if (document.location.hash == "") { - document.querySelector(".tabs ul li:first-child a").click(); + const hash = document.querySelector(".tabs ul li:first-child a").href; + window.location.replaceState(undefined, undefined, hash); } else { set_active_tab(); } diff --git a/changedetectionio/templates/watch-overview.html b/changedetectionio/templates/watch-overview.html index 24027ff4d..9f0d1c3c8 100644 --- a/changedetectionio/templates/watch-overview.html +++ b/changedetectionio/templates/watch-overview.html @@ -153,10 +153,10 @@ class="recheck pure-button pure-button-primary">{% if watch.uuid in queued_uuids %}Queued{% else %}Recheck{% endif %} Edit {% if watch.history_n >= 2 %} - Diff + Diff {% else %} {% if watch.history_n == 1 or (watch.history_n ==0 and watch.error_text_ctime )%} - Preview + Preview {% endif %} {% endif %}