Merge pull request #4 from CAtlas0784/test-gay
fix: use API client for damage reports
This commit is contained in:
1 file changed
+3
-3
@@ -7996,7 +7996,7 @@ async function fetchLatestBattleReport(silent = false) {
|
|||||||
if (analystState.isFetching) return;
|
if (analystState.isFetching) return;
|
||||||
analystState.isFetching = true;
|
analystState.isFetching = true;
|
||||||
try {
|
try {
|
||||||
const data = await apiRequest('/api/battle_report', 'GET');
|
const data = await apiCall('/api/battle_report', 'GET');
|
||||||
if (data && data.has_report && data.report) {
|
if (data && data.has_report && data.report) {
|
||||||
const isNew = data.report.timestamp !== analystState.lastBattleTimestamp;
|
const isNew = data.report.timestamp !== analystState.lastBattleTimestamp;
|
||||||
analystState.currentReport = data.report;
|
analystState.currentReport = data.report;
|
||||||
@@ -8313,7 +8313,7 @@ async function clearBattleReport() {
|
|||||||
analystState.currentReport = null;
|
analystState.currentReport = null;
|
||||||
analystState.lastBattleTimestamp = 0;
|
analystState.lastBattleTimestamp = 0;
|
||||||
try {
|
try {
|
||||||
await apiRequest('/api/battle_report/reset', 'POST');
|
await apiCall('/api/battle_report/reset', 'POST');
|
||||||
} catch (_) {}
|
} catch (_) {}
|
||||||
renderEmptyDamageAnalyst();
|
renderEmptyDamageAnalyst();
|
||||||
updateDashboardBattleBanner();
|
updateDashboardBattleBanner();
|
||||||
@@ -8481,7 +8481,7 @@ function setupDamageAnalystEvents() {
|
|||||||
showToast(t('analystToastImported'), 'success');
|
showToast(t('analystToastImported'), 'success');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await apiRequest('/api/battle_report', 'POST', report);
|
await apiCall('/api/battle_report', 'POST', report);
|
||||||
} catch (_) {}
|
} catch (_) {}
|
||||||
} else {
|
} else {
|
||||||
showToast('รูปแบบไฟล์ JSON ไม่ถูกต้อง (ต้องการ GaC Battle Report หรือ Firefly-Sranalysis JSON)', 'error');
|
showToast('รูปแบบไฟล์ JSON ไม่ถูกต้อง (ต้องการ GaC Battle Report หรือ Firefly-Sranalysis JSON)', 'error');
|
||||||
|
|||||||
Reference in new issue
Block a user