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