mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2026-11-30 03:42:15 +03:00
indexed sparse list rather than guessing
This commit is contained in:
1 file changed
+5
-2
@@ -55,7 +55,7 @@ import killswitch
|
||||
from config import appversion, appversion_nobuild, config, copyright
|
||||
# isort: on
|
||||
|
||||
from companion import CAPIData
|
||||
from companion import CAPIData, index_possibly_sparse_list
|
||||
from EDMCLogging import edmclogger, logger, logging
|
||||
from journal_lock import JournalLock, JournalLockResult
|
||||
|
||||
@@ -903,7 +903,10 @@ class AppWindow(object):
|
||||
if (suit := loadout.get('suit')) is not None:
|
||||
if (suitname := suit.get('locName')) is not None:
|
||||
# We've been paranoid about loadout->suit->suitname, now just assume loadouts is there
|
||||
loadout_name = data['loadouts'][loadout['loadoutSlotId']]['name']
|
||||
loadout_name = index_possibly_sparse_list(
|
||||
data['loadouts'], loadout['loadoutSlotId']
|
||||
)['name']
|
||||
|
||||
self.suit['text'] = f'{suitname} ({loadout_name})'
|
||||
|
||||
self.toggle_suit_row(visible=True)
|
||||
|
||||
Reference in new issue
Block a user