From 1e0ace8e2722814837d4be616c84f01762aaf393 Mon Sep 17 00:00:00 2001 From: John Ohno Date: Thu, 14 Jul 2022 14:39:47 -0400 Subject: [PATCH] make stripNulls into a function; handle nulls in timeline differently --- fern | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fern b/fern index 3e193d0..47890c0 100755 --- a/fern +++ b/fern @@ -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 @@ -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: @@ -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