From 2797f5ee68b6828cd8677f91831c1cdb50572c52 Mon Sep 17 00:00:00 2001 From: DevilXD Date: Sat, 5 Nov 2022 19:25:30 +0100 Subject: [PATCH] Fix the app hanging while it's closed during loading --- twitch.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/twitch.py b/twitch.py index 3b726ba..2f19001 100644 --- a/twitch.py +++ b/twitch.py @@ -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: