Fix the app hanging while it's closed during loading

This commit is contained in:
DevilXD committed 2022-11-05 19:25:30 +01:00
1 parent 26a5787fa7
commit 2797f5ee68
1 file changed
+4
+4
View File
@@ -349,6 +349,7 @@ class Twitch:
while True:
try:
await self._run()
break
except ReloadRequest:
await self.shutdown()
except ExitRequest:
@@ -1062,6 +1063,9 @@ class Twitch:
self._drops.update({drop.id: drop for drop in campaign.drops})
# NOTE: this fetches pictures from the CDN, so might be slow without a cache
await self.gui.inv.add_campaign(campaign)
# this is needed here explicitly, because images aren't always fetched
if self.gui.close_requested:
raise ExitRequest()
self.inventory.append(campaign)
def get_active_drop(self, channel: Channel | None = None) -> TimedDrop | None: