Fix a bug with not claiming one of the two drops;
if two of them happened to be earned at the same time.
This commit is contained in:
1 parent
0388fdc290
commit
88d7ffa520
2 files changed
+7
-6
No files matched your search
@@ -455,9 +455,9 @@ class CampaignProgress:
|
|||||||
# tray
|
# tray
|
||||||
tray = self._manager.tray
|
tray = self._manager.tray
|
||||||
tray.display_progress(drop)
|
tray.display_progress(drop)
|
||||||
|
self.stop_timer()
|
||||||
if countdown:
|
if countdown:
|
||||||
# reschedule our seconds update timer
|
# restart our seconds update timer
|
||||||
self.stop_timer()
|
|
||||||
self.start_timer()
|
self.start_timer()
|
||||||
elif subone:
|
elif subone:
|
||||||
# display the current remaining time at 0 seconds (after substracting the minute)
|
# display the current remaining time at 0 seconds (after substracting the minute)
|
||||||
|
|||||||
@@ -489,9 +489,6 @@ class Twitch:
|
|||||||
self.gui.tray.notify(claim_text, "Mined Drop")
|
self.gui.tray.notify(claim_text, "Mined Drop")
|
||||||
else:
|
else:
|
||||||
logger.error(f"Drop claim failed! Drop ID: {drop_id}")
|
logger.error(f"Drop claim failed! Drop ID: {drop_id}")
|
||||||
if not mined or campaign.remaining_drops == 0:
|
|
||||||
self.change_state(State.GAMES_UPDATE)
|
|
||||||
return
|
|
||||||
# About 4-20s after claiming the drop, next drop can be started
|
# About 4-20s after claiming the drop, next drop can be started
|
||||||
# by re-sending the watch payload. We can test for it by fetching the current drop
|
# by re-sending the watch payload. We can test for it by fetching the current drop
|
||||||
# via GQL, and then comparing drop IDs.
|
# via GQL, and then comparing drop IDs.
|
||||||
@@ -500,9 +497,13 @@ class Twitch:
|
|||||||
context = await self.gql_request(GQL_OPERATIONS["CurrentDrop"])
|
context = await self.gql_request(GQL_OPERATIONS["CurrentDrop"])
|
||||||
drop_data: JsonType = context["data"]["currentUser"]["dropCurrentSession"]
|
drop_data: JsonType = context["data"]["currentUser"]["dropCurrentSession"]
|
||||||
if drop_data["dropID"] != drop.id:
|
if drop_data["dropID"] != drop.id:
|
||||||
self.restart_watching()
|
# When two drops are ready to be claimed, we receive an update only for one.
|
||||||
|
# This means we have to refresh the games list and claim any additional drops
|
||||||
|
# after each earned drop, claimed or not.
|
||||||
break
|
break
|
||||||
await asyncio.sleep(2)
|
await asyncio.sleep(2)
|
||||||
|
# This also restarts the watch loop as needed here.
|
||||||
|
self.change_state(State.GAMES_UPDATE)
|
||||||
return
|
return
|
||||||
assert msg_type == "drop-progress"
|
assert msg_type == "drop-progress"
|
||||||
watching_channel = self.watching_channel.get_with_default(None)
|
watching_channel = self.watching_channel.get_with_default(None)
|
||||||
|
|||||||
Reference in new issue
Block a user