diff --git a/src/functions/wish.js b/src/functions/wish.js index ab922be8..16b0c703 100644 --- a/src/functions/wish.js +++ b/src/functions/wish.js @@ -104,6 +104,7 @@ export function process(id) { const nextBanner = getNextBanner(pull.time, currentBannerIndex, selectedBanners); if (nextBanner === undefined) { + console.log('error banner here', JSON.stringify(pull)); pushToast(t('wish.errorBanner'), 'error'); return null; } diff --git a/src/routes/wish/[id].svelte b/src/routes/wish/[id].svelte index ad884e2d..98c9f4ed 100644 --- a/src/routes/wish/[id].svelte +++ b/src/routes/wish/[id].svelte @@ -41,6 +41,8 @@ beginners: 'beginners', }; + let errorProcessingPull = ''; + const bannerType = bannerTypes[id]; let bannerChart; let pieChart; @@ -138,6 +140,8 @@ currentBanner = getNextBanner(pull.time); if (currentBanner === undefined) { + console.log('error banner here', JSON.stringify(pull)); + errorProcessingPull = JSON.stringify(pull); pushToast($t('wish.errorBanner'), 'error'); return; } @@ -234,32 +238,32 @@ await tick(); - setTimeout(() => { - new Chart(pieChart, { - type: 'pie', - data: { - labels: ['Total Pulls', 'Total 5*', 'Total 4*'], - datasets: [ - { - label: 'total', - data: [currentPulls.length, allLegendary.length, allRare.length], - backgroundColor: ['rgba(107, 161, 192, 0.7)', 'rgba(255, 177, 63, 0.7)', 'rgba(210, 143, 214, 0.7)'], - borderColor: ['#6BA1C0', '#FFB13F', '#D28FD6'], - borderWidth: 1, - }, - ], - }, - options: { - responsive: true, - legend: { - display: false, - }, - tooltips: { - mode: 'dataset', + new Chart(pieChart, { + type: 'pie', + data: { + labels: ['Total Pulls', 'Total 5*', 'Total 4*'], + datasets: [ + { + label: 'total', + data: [currentPulls.length, allLegendary.length, allRare.length], + backgroundColor: ['rgba(107, 161, 192, 0.7)', 'rgba(255, 177, 63, 0.7)', 'rgba(210, 143, 214, 0.7)'], + borderColor: ['#6BA1C0', '#FFB13F', '#D28FD6'], + borderWidth: 1, }, + ], + }, + options: { + responsive: true, + legend: { + display: false, }, - }); + tooltips: { + mode: 'dataset', + }, + }, + }); + if (id === 'character-event' || id === 'weapon-event') { new Chart(bannerChart, { type: 'bar', data: { @@ -319,7 +323,7 @@ }, }, }); - }, 500); + } } function sortPulls() { @@ -403,6 +407,9 @@ {#if loading}
{$t('wish.detail.loading')}
+ {#if errorProcessingPull !== ''} + Error when getting banner for {errorProcessingPull} + {/if} {:else}