Check banner if exists

This commit is contained in:
Made Baruna 2022-07-01 19:03:33 +07:00
parent b438f5fbaf
commit 3ae3ae995c

View file

@ -411,7 +411,7 @@
const path = `wish-counter-${type.id}`;
const localData = await readSave(`${prefix}${path}`);
const withRate = type.id === 'character-event' || type.id === 'weapon-event';
let withRate = type.id === 'character-event' || type.id === 'weapon-event';
let localWishes = [];
if (localData !== null) {
@ -465,6 +465,7 @@
rarity = weaponList[combined[i].id].rarity;
}
try {
const unixTime = dayjs(combined[i].time).unix();
if (withRate && (currentSelectedBanner === null || currentSelectedBanner.end < unixTime)) {
lastBannerIndex = currentBannerIndex;
@ -480,6 +481,10 @@
lastBanner = currentSelectedBanner;
}
}
} catch (err) {
withRate = false;
console.log('ERROR PARSE BANNER', combined[i]);
}
// guaranteed + winrateoff
// f + f = 0 = los 50:50