Add boot phase status messages

This commit is contained in:
Dymas
2026-06-22 10:32:32 +02:00
parent b52510df67
commit 609ed65f4f
+8
View File
@@ -8,6 +8,8 @@ function setBootStatus(message: string): void {
document.getElementById('boot-status')!.textContent = message; document.getElementById('boot-status')!.textContent = message;
} }
setBootStatus('Starting frontend bundle...');
window.addEventListener('error', (event) => { window.addEventListener('error', (event) => {
setBootStatus(`Frontend error: ${event.message || 'unknown'}`); setBootStatus(`Frontend error: ${event.message || 'unknown'}`);
}); });
@@ -16,11 +18,17 @@ window.addEventListener('unhandledrejection', (event) => {
setBootStatus(`Frontend rejection: ${String(event.reason || 'unknown')}`); setBootStatus(`Frontend rejection: ${String(event.reason || 'unknown')}`);
}); });
const bootTimeout = window.setTimeout(() => {
setBootStatus('Bootstrap still running...');
}, 3000);
bootstrapApplication(AppComponent, appConfig) bootstrapApplication(AppComponent, appConfig)
.then(() => { .then(() => {
window.clearTimeout(bootTimeout);
document.getElementById('boot-status')?.remove(); document.getElementById('boot-status')?.remove();
}) })
.catch((err) => { .catch((err) => {
window.clearTimeout(bootTimeout);
console.error(err); console.error(err);
setBootStatus(`Bootstrap failed: ${String(err)}`); setBootStatus(`Bootstrap failed: ${String(err)}`);
}); });