mirror of https://gitlab.com/brutaldon/brutaldon
Handle case of no notes seen before checking notifications
This commit is contained in:
parent
c7fb38b57c
commit
10019b34b0
|
@ -46,6 +46,9 @@ def _notes_count(account, mastodon):
|
||||||
if account.preferences.filter_notifications:
|
if account.preferences.filter_notifications:
|
||||||
notes = [ note for note in notes if note.type == 'mention' or note.type == 'follow']
|
notes = [ note for note in notes if note.type == 'mention' or note.type == 'follow']
|
||||||
for index, item in enumerate(notes):
|
for index, item in enumerate(notes):
|
||||||
|
if account.note_seen is None:
|
||||||
|
account.note_seen = 0
|
||||||
|
account.save()
|
||||||
if item.id <= account.note_seen:
|
if item.id <= account.note_seen:
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue