Fix excel import if wish is empty

This commit is contained in:
Made Baruna 2021-06-07 14:27:52 +07:00
parent eaae159e53
commit de05a8fd63
No known key found for this signature in database
GPG key ID: 5AA5DA16AA5DCEAD

View file

@ -44,9 +44,11 @@
let oldest = dayjs().year(2200);
if (data !== null) {
newest = dayjs(data.pulls[data.pulls.length - 1].time);
oldest = dayjs(data.pulls[0].time);
pulls = data.pulls;
if (data.pulls.length > 0) {
newest = dayjs(data.pulls[data.pulls.length - 1].time);
oldest = dayjs(data.pulls[0].time);
pulls = data.pulls;
}
}
return {
@ -230,7 +232,7 @@
'character-event': 'Character Event Wish',
'weapon-event': 'Weapon Event Wish',
standard: 'Permanent Wish',
beginners: "Novice Wishes",
beginners: 'Novice Wishes',
};
const weapons = Object.values(weaponList);