Commit a92f815c authored by Vildravn's avatar Vildravn
Browse files

Affix fix, remove logs

parent 2579ef69
......@@ -64,7 +64,6 @@ const slBosses = {
// -----------------------------
let REGION = args.widgetParameter || 'EU';
REGION = (REGION.toUpperCase() == 'US' ? 'US' : 'EU');
log(REGION);
const cheerio = importModule('cheerio');
let $ = undefined;
......@@ -103,7 +102,7 @@ async function createWidget(size) {
let whData = await fetchData("https://www.wowhead.com", "loadString");
$ = cheerio.load(whData);
let data = undefined;
let data = null;
whData = undefined;
delete (whData);
......@@ -128,7 +127,6 @@ async function createWidget(size) {
await buildAffixDisplay(rightColumn, data);
rightColumn.addSpacer(20);
data = await parseTextGroup(`#${REGION}-group-epiceliteworldsl`, `.tiw-region[data-region="${REGION}"]`);
log(data);
const bossLink = (data ? slBosses[data[0]] : null);
await buildTextDisplay(rightColumn, "world boss", data, bossLink);
......@@ -154,10 +152,12 @@ async function createWidget(size) {
async function buildAffixDisplay(parent, affixes) {
const levels = ["2+", "4+", "7+", "10+"];
for (let i = 0; i < affixes.length; i++) {
let affix = affixes[i];
if (affixes) {
for (let i = 0; i < affixes.length; i++) {
let affix = affixes[i];
affix.text = levels[i];
affix.text = levels[i];
}
}
await buildImageDisplay(parent, "mythic+ affixes", affixes);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment