From 6aded50aca8114c663476c9477fb41182a715e8e Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Wed, 5 Jun 2024 11:46:04 +0200 Subject: [PATCH] UI - 'Mark all viewed' button should not show when all viewed (#2399) --- changedetectionio/store.py | 2 +- changedetectionio/tests/test_backend.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/changedetectionio/store.py b/changedetectionio/store.py index afa6b2ae..6e84ac2f 100644 --- a/changedetectionio/store.py +++ b/changedetectionio/store.py @@ -178,7 +178,7 @@ class ChangeDetectionStore: @property def has_unviewed(self): for uuid, watch in self.__data['watching'].items(): - if watch.viewed == False: + if watch.history_n >= 2 and watch.viewed == False: return True return False diff --git a/changedetectionio/tests/test_backend.py b/changedetectionio/tests/test_backend.py index 78c3b6fa..2d21067e 100644 --- a/changedetectionio/tests/test_backend.py +++ b/changedetectionio/tests/test_backend.py @@ -135,6 +135,9 @@ def test_check_basic_change_detection_functionality(client, live_server): # It should have picked up the assert b'head title' in res.data + # Be sure the last_viewed is going to be greater than the last snapshot + time.sleep(1) + # hit the mark all viewed link res = client.get(url_for("mark_all_viewed"), follow_redirects=True)