Recover battle history keys by id
This commit is contained in:
@@ -852,13 +852,13 @@ function normalizeInventory(value: unknown) {
|
||||
}
|
||||
|
||||
function normalizeBattleHistory(value: unknown) {
|
||||
return Object.entries(recordOrEmpty<unknown>(value)).reduce<Record<string, CampaignBattleSettlement>>((history, [key, settlement]) => {
|
||||
return Object.entries(recordOrEmpty<unknown>(value)).reduce<Record<string, CampaignBattleSettlement>>((history, [, settlement]) => {
|
||||
const normalizedSettlement = normalizeCampaignBattleSettlement(settlement);
|
||||
if (!normalizedSettlement) {
|
||||
return history;
|
||||
}
|
||||
|
||||
history[key] = normalizedSettlement;
|
||||
history[normalizedSettlement.battleId] = normalizedSettlement;
|
||||
return history;
|
||||
}, {});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user