fix(tasklist): Harden update propagator.

Fixes an issue where updates would fail when listeners updated.
Fixes a typo where the wrong UI was closed on HTTPException.
This commit is contained in:
2023-09-11 10:29:53 +03:00
parent d14b0880eb
commit a9a21b1735

View File

@@ -231,14 +231,18 @@ class TasklistCog(LionCog):
# Now do the rest of the listening channels
listening = TasklistUI._live_[userid]
for cid, ui in listening.items():
for cid, ui in list(listening.items()):
if channel and channel.id == cid:
# We already did this channel
continue
if cid not in listening:
# UI closed while we were updating
continue
try:
await ui.refresh()
await ui.redraw()
except discord.HTTPException:
await tui.close()
await ui.close()
@cmds.hybrid_command(
name=_p('cmd:tasklist', "tasklist"),