fix: auto-reload page after enrichment action completes
Some checks are pending
NordaBiz Tests / Unit & Integration Tests (push) Waiting to run
NordaBiz Tests / E2E Tests (Playwright) (push) Blocked by required conditions
NordaBiz Tests / Smoke Tests (Production) (push) Blocked by required conditions
NordaBiz Tests / Send Failure Notification (push) Blocked by required conditions

Individual action buttons now reload the page after 1.5s to reflect
updated data and status indicators. The master "Uzbrój firmę" workflow
skips per-step reload and only reloads once after all steps complete.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Maciej Pienczyn 2026-02-20 13:34:05 +01:00
parent ff35ef6b43
commit e92accc1ed

View File

@ -719,6 +719,8 @@
}, 5000);
}
var _skipReload = false;
function runEnrichAction(btn, url, body) {
var original = btn.innerHTML;
btn.disabled = true;
@ -733,6 +735,9 @@
if (data.success) {
showToast(data.message || 'Gotowe!', 'success');
btn.innerHTML = '<svg fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24" style="width:16px;height:16px"><path d="M5 13l4 4L19 7"/></svg> Gotowe';
if (!_skipReload) {
setTimeout(function() { location.reload(); }, 1500);
}
return true;
} else {
showToast(data.error || 'Wystąpił błąd', 'error');
@ -775,6 +780,7 @@
}
function armCompany() {
_skipReload = true;
var masterBtn = document.getElementById('btn-arm');
masterBtn.disabled = true;
masterBtn.innerHTML = '<span class="spinner"></span> Uzbrajam firmę...';