From fcfae2d9f2651f0ae95066d838f0e070761c1518 Mon Sep 17 00:00:00 2001 From: Max de Krieger Date: Sat, 28 Jan 2023 17:15:23 +0100 Subject: [PATCH] update front-end to use renown object with properties instead of maxRenown --- src/api/reputations.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/api/reputations.js b/src/api/reputations.js index 7ba951ea..69868009 100644 --- a/src/api/reputations.js +++ b/src/api/reputations.js @@ -72,8 +72,9 @@ function parseFactions(all_factions, my_reputations) { }; // If it's a faction with renown such as Dragonflight factions - if (faction.maxRenown) { - f.levels = maxRenownToLevels(faction.maxRenown); + if (faction.renown) { + const step = faction.renown.step || 2500; + f.levels = renownToLevels(faction.renown.max, step); f.renown = true; } @@ -110,9 +111,9 @@ function levelsAsList(levelsDict) { return items; } -function maxRenownToLevels(maxRenown, step = 2500) { +function renownToLevels(max, step) { var items = []; - for (i = 0; i <= maxRenown; i++) { + for (i = 0; i <= max; i++) { items.push([i * step, "Renown " + i]) } return items;