Skip to content

Commit

Permalink
additional condition to announcementchecker class
Browse files Browse the repository at this point in the history
  • Loading branch information
shrivaths16 committed Nov 30, 2023
1 parent d35f029 commit 21ea789
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sleap/gui/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,21 +171,21 @@ def _read_bulletin_data(self):
data = json.load(jsf)
self._latest_data = data[0]
except FileNotFoundError:
self._latest_data = {}
self._latest_data = None

@property
def new_announcement(self):
def new_announcement_available(self):
self._read_bulletin_data()
if (
self._latest_data
self._latest_data and self.previous_announcement_date
and self._latest_data["date"] != self.previous_announcement_date
):
return True
return False

def get_latest_announcement(self) -> Optional[Tuple[str, str]]:
"""Return latest announcements on the releases page not seen by user."""
if self.new_announcement:
if self.new_announcement_available:
return (
self._latest_data["title"],
self._latest_data["date"],
Expand Down

0 comments on commit 21ea789

Please sign in to comment.