From 4df52f6c134519bb3af4dcfff856a69a633bb7ec Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 29 Nov 2020 09:49:48 +0000 Subject: [PATCH] Only show the replies button if replies exist. This simplifies the first time user experience a little --- webapp_headerbuttons.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/webapp_headerbuttons.py b/webapp_headerbuttons.py index 241902b8..2b138f5b 100644 --- a/webapp_headerbuttons.py +++ b/webapp_headerbuttons.py @@ -7,6 +7,7 @@ __email__ = "bob@freedombone.net" __status__ = "Production" +import os import time from datetime import datetime from happening import todaysEventsCheck @@ -87,11 +88,15 @@ def headerButtonsTimeline(defaultTimeline: str, '">' + htmlHighlightLabel(translate['DM'], newDM) + \ '' - tlStr += \ - '' + repliesIndexFilename = \ + baseDir + '/accounts/' + \ + nickname + '@' + domain + '/tlreplies.index' + if os.path.isfile(repliesIndexFilename): + tlStr += \ + '' # typically the media button if defaultTimeline != 'tlmedia':