Another fix for refresh.

This commit is contained in:
=
2026-02-04 22:32:27 -05:00
parent fdad92047b
commit dbc5878fe2
3 changed files with 35 additions and 13 deletions

View File

@@ -152,9 +152,18 @@ function submitRefine(event) {
modal.show();
refinePollInterval = setInterval(() => {
fetch(`/task_status/${data.task_id}`).then(r => r.json()).then(status => {
if (status.status === 'completed') window.location.reload();
});
fetch(`/task_status/${data.task_id}`)
.then(r => r.json())
.then(status => {
if (status.status === 'completed') {
clearInterval(refinePollInterval);
if (status.success === false) {
alert("Refinement failed: " + (status.error || "Check logs"));
}
window.location.reload();
}
})
.catch(e => console.error(e));
}, 2000);
}
})