Each account gets a new share notification

main2
Bob Mottram 2019-11-02 11:36:56 +00:00
parent b877af4ae8
commit 6fc3eac50d
2 changed files with 12 additions and 8 deletions

View File

@ -145,13 +145,17 @@ def addShare(baseDir: str, \
saveJson(sharesJson,sharesFilename) saveJson(sharesJson,sharesFilename)
# indicate that a new share is available # indicate that a new share is available
newShareFile=baseDir+'/accounts/.newShare' for subdir, dirs, files in os.walk(baseDir+'/accounts'):
if not os.path.isfile(newShareFile): for handle in dirs:
try: if '@' in handle:
with open(newShareFile, 'w') as fp: accountDir=baseDir+'/accounts/'+handle
fp.write('\n') newShareFile=accountDir+'/.newShare'
except: if not os.path.isfile(newShareFile):
pass try:
with open(newShareFile, 'w') as fp:
fp.write('\n')
except:
pass
def expireShares(baseDir: str) -> None: def expireShares(baseDir: str) -> None:
"""Removes expired items from shares """Removes expired items from shares

View File

@ -2195,7 +2195,7 @@ def htmlTimeline(translate: {},pageNumber: int, \
# should the Shares button be highlighted? # should the Shares button be highlighted?
newShare=False newShare=False
newShareFile=baseDir+'/accounts/.newShare' newShareFile=accountDir+'/.newShare'
if os.path.isfile(newShareFile): if os.path.isfile(newShareFile):
newShare=True newShare=True
if boxName=='tlshares': if boxName=='tlshares':