mirror of
https://github.com/MadeBaruna/paimon-moe.git
synced 2025-01-06 02:35:25 +01:00
Add error reporting
This commit is contained in:
parent
fd96099140
commit
998ebc1130
6 changed files with 33 additions and 4 deletions
|
@ -43,7 +43,7 @@
|
|||
|
||||
timeout = setTimeout(() => {
|
||||
handleError();
|
||||
}, 5000);
|
||||
}, 15000);
|
||||
}
|
||||
|
||||
function cancelTimeout() {
|
||||
|
|
|
@ -6,6 +6,7 @@ import { readSave } from '../stores/saveManager';
|
|||
import { banners } from '../data/banners';
|
||||
import { weaponList } from '../data/weaponList';
|
||||
import { characters } from '../data/characters';
|
||||
import { pushToast } from '../stores/toast';
|
||||
|
||||
const bannerTypes = {
|
||||
'character-event': 'characters',
|
||||
|
@ -97,6 +98,17 @@ export function process(id) {
|
|||
|
||||
if (currentBanner === null || currentBanner.end < pull.time) {
|
||||
const nextBanner = getNextBanner(pull.time, currentBannerIndex, selectedBanners);
|
||||
|
||||
if (nextBanner === undefined) {
|
||||
pushToast('Something went wrong, please leave a message on Discord 😅', 'error');
|
||||
Sentry.captureException(new Error('failed to get current banner'), {
|
||||
contexts: {
|
||||
pull,
|
||||
},
|
||||
});
|
||||
return null;
|
||||
}
|
||||
|
||||
currentBanner = nextBanner.selectedBanner;
|
||||
currentBannerIndex = nextBanner.currentBannerIndex;
|
||||
startBanner = true;
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
"welcomeStart2": "button up there",
|
||||
"manual": "If you want to manually input the data, you can enable it here:",
|
||||
"manualButton": "Enable Manual Input",
|
||||
"errorBanner": "Banner time missmatch! Please adjust your server. Still not working? please leave a message on Discord 😅",
|
||||
"import": {
|
||||
"title": "Import Wish History",
|
||||
"faqsButton": "FAQ - READ FIRST",
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
"welcomeStart2": "diatas untuk mulai",
|
||||
"manual": "Jika kamu ingin memasukkan datanya secara manual, kamu bisa menyalakannya disini:",
|
||||
"manualButton": "Nyalakan Input Manual",
|
||||
"errorBanner": "Waktu banner salah! Coba sesuaikan server. Masih gak bisa? tolong chat di Discord 😅",
|
||||
"import": {
|
||||
"title": "Import Riwayat Wish",
|
||||
"faqsButton": "FAQS - BACA DULU",
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
import { getAccountPrefix } from '../../stores/account';
|
||||
import { fromRemote, readSave } from '../../stores/saveManager';
|
||||
import { getTimeOffset } from '../../stores/server';
|
||||
import { pushToast } from '../../stores/toast';
|
||||
|
||||
Chart.defaults.global.defaultFontColor = '#cbd5e0';
|
||||
Chart.defaults.global.defaultFontFamily = 'Poppins';
|
||||
|
@ -135,6 +136,17 @@
|
|||
|
||||
if (currentBanner === null || currentBanner.end < pull.time) {
|
||||
currentBanner = getNextBanner(pull.time);
|
||||
|
||||
if (currentBanner === undefined) {
|
||||
pushToast($t('wish.errorBanner'), 'error');
|
||||
Sentry.captureException(new Error('failed to get current banner'), {
|
||||
contexts: {
|
||||
pull,
|
||||
},
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
startBanner = true;
|
||||
|
||||
if (i > 0) {
|
||||
|
@ -294,7 +306,6 @@
|
|||
return selectedBanners[tooltipItem[0].index].name;
|
||||
},
|
||||
label: (tooltipItem, data) => {
|
||||
console.log(tooltipItem, data);
|
||||
const label = data.datasets[tooltipItem.datasetIndex].label;
|
||||
const value =
|
||||
tooltipItem.datasetIndex === 2
|
||||
|
@ -514,7 +525,10 @@
|
|||
</td>
|
||||
{#if sortBy === 'time' && ((pull.end && !sortOrder) || (pull.start && sortOrder))}
|
||||
<td class="relative hidden xl:table-cell">
|
||||
<div class="border-t border-gray-700 absolute left-0 top-0 z-10 border-start" style="width: 266px;" />
|
||||
<div
|
||||
class="border-t border-gray-700 absolute left-0 top-0 z-10 border-start"
|
||||
style="width: 266px;"
|
||||
/>
|
||||
</td>
|
||||
<td class="sticky w-0 hidden xl:table-cell pl-2" style="top: 8px;">
|
||||
<div
|
||||
|
@ -661,7 +675,7 @@
|
|||
}
|
||||
|
||||
/* firefox bug */
|
||||
@supports (-moz-appearance:none) {
|
||||
@supports (-moz-appearance: none) {
|
||||
.border-start {
|
||||
top: -1px;
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
<link rel="manifest" href="manifest.json" crossorigin="use-credentials" />
|
||||
<link rel="icon" type="image/png" href="favicon.png" />
|
||||
|
||||
<script src="https://js.sentry-cdn.com/446c4cef71a54aafb71b698555500b7d.min.js" crossorigin="anonymous"></script>
|
||||
<script async defer data-domain="paimon.moe" src="https://plausible.paimon.moe/js/plausible.js"></script>
|
||||
|
||||
<style>
|
||||
|
|
Loading…
Reference in a new issue