Spaces:
Sleeping
Sleeping
Commit
Β·
8dca04f
1
Parent(s):
31a84a9
Add system
Browse files
test.html
CHANGED
@@ -261,7 +261,7 @@
|
|
261 |
loadEvents(lastUsedFile);
|
262 |
}
|
263 |
}, 200);
|
264 |
-
} else if (
|
265 |
clearInterval(window.pollIntervalId);
|
266 |
window.pollIntervalId = null;
|
267 |
statusElement.innerHTML += `<div class="mt-2 text-red-600 font-semibold">β The process failed.</div>`;
|
@@ -315,9 +315,9 @@
|
|
315 |
try {
|
316 |
const fileParam = encodeURIComponent(file);
|
317 |
const eventsRes = await fetch(`/api/events?file=${fileParam}`);
|
318 |
-
if (!eventsRes.ok) throw new Error("Event file not found or malformed");
|
319 |
const data = await eventsRes.json();
|
320 |
-
if (!Array.isArray(data)) throw new Error("Unexpected data format");
|
321 |
|
322 |
if (data.length === 0) {
|
323 |
p.innerHTML = `<div class="text-gray-500 italic"> Sorry, we do not find any progress for this pledge.</div>`;
|
|
|
261 |
loadEvents(lastUsedFile);
|
262 |
}
|
263 |
}, 200);
|
264 |
+
} else if (Object.values(data.status || {}).some(v => v.startsWith("β"))) {
|
265 |
clearInterval(window.pollIntervalId);
|
266 |
window.pollIntervalId = null;
|
267 |
statusElement.innerHTML += `<div class="mt-2 text-red-600 font-semibold">β The process failed.</div>`;
|
|
|
315 |
try {
|
316 |
const fileParam = encodeURIComponent(file);
|
317 |
const eventsRes = await fetch(`/api/events?file=${fileParam}`);
|
318 |
+
if (!eventsRes.ok) throw new Error("β Event file not found or malformed");
|
319 |
const data = await eventsRes.json();
|
320 |
+
if (!Array.isArray(data)) throw new Error("β Unexpected data format");
|
321 |
|
322 |
if (data.length === 0) {
|
323 |
p.innerHTML = `<div class="text-gray-500 italic"> Sorry, we do not find any progress for this pledge.</div>`;
|