Skip to content

Commit

Permalink
make stripNulls into a function; handle nulls in timeline differently
Browse files Browse the repository at this point in the history
  • Loading branch information
enkiv2 committed Jul 14, 2022
1 parent 24b7a61 commit 1e0ace8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions fern
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,9 @@ def drawPanelContents(toots, selectedIdx, skipSeen=False):
for toot in toots:
if(i>(ROWS-3)/4): continue
if toot==None:
if i==selectedIdx:
selectedIdx+=1
drawMsgPanel(i, "", "", "MESSAGE UNAVAILABLE", "", True)
if i==selectedIdx:
drawSelectedMsg("", "", "", "MESSAGE UNAVAILABLE", True)
else:
if "reblog" in toot and toot["reblog"] and type(toot["reblog"])==type(toot): toot=toot["reblog"]
if "muted" in toot or not "id" in toot: next
Expand Down Expand Up @@ -638,7 +638,7 @@ def ensureCached(toot, verbose=False, ignoreErrors=True, msg=None):
if None==toot:
return None
if type(toot)==list: # list of TIDs or toots
return [x for x in list(map(lambda x: ensureCached(x, verbose, ignoreErrors, msg), toot)) if None!=x]
return stripNulls([ensureCached(x, verbose, ignoreErrors, msg) for x in toot])
elif type(toot) in [str, unicode]: # TID
suffix=toot
if not toot in tootbase:
Expand Down Expand Up @@ -680,6 +680,9 @@ def dirty(tid):
global tb_dirty
tb_dirty[int(tid[-2:])]=True

def stripNulls(l):
return [x for x in l if None!=x]

def saveBase():
statusMsg("Saving tootbase...", False)
global tootbase, acctbase, seen_toots, cwrules, tb_dirty
Expand Down

0 comments on commit 1e0ace8

Please sign in to comment.