From ec4e652ab39a2723a93f59353a5589bafc4abd84 Mon Sep 17 00:00:00 2001 From: DevilXD Date: Sun, 2 Jan 2022 17:35:14 +0100 Subject: [PATCH] start the websocket after we confirm there are drops to mine --- twitch.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/twitch.py b/twitch.py index 1bdfd4b..f054e2a 100644 --- a/twitch.py +++ b/twitch.py @@ -160,7 +160,6 @@ class Twitch: WebsocketTopic("User", "Drops", self._user_id, self.process_drops), WebsocketTopic("User", "CommunityPoints", self._user_id, self.process_points), ]) - await self.websocket.start() games: Set[Game] = set() selected_game: Optional[Game] = None self.change_state(State.INVENTORY_FETCH) @@ -185,6 +184,8 @@ class Twitch: if not games: self.gui.print("No active campaigns to farm drops for.") return + # only start the websocket after we confirm there are drops to mine + await self.websocket.start() self.gui.games.set_games(games) selected_game = self.gui.games.get_selection() self.change_state(State.CHANNEL_FETCH)