1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-14 16:27:13 +03:00

Suits: If user switches to an unknown loadout, say so

This commit is contained in:
Athanasius 2021-04-13 16:56:48 +01:00
parent c28dd8c55d
commit bb90d0fb59
2 changed files with 4 additions and 0 deletions

View File

@ -607,11 +607,13 @@ class AppWindow(object):
def update_suit_text(self) -> None:
"""Update the suit text for current type and loadout."""
if (suit := monitor.state.get('SuitCurrent')) is None:
self.suit['text'] = f'<{_("Unknown")}>'
return
suitname = suit['locName']
if (suitloadout := monitor.state.get('SuitLoadoutCurrent')) is None:
self.suit['text'] = ''
return
loadout_name = suitloadout['name']

View File

@ -839,6 +839,8 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below
except KeyError:
logger.exception(f"Getting suit loadout after switch, bad slot: {new_slot} ({loadoutid})")
# Might mean that a new suit loadout was created and we need a new CAPI fetch ?
self.state['SuitCurrent'] = None
self.state['SuitLoadoutCurrent'] = None
else:
try: