Add boot phase status messages
This commit is contained in:
@@ -8,6 +8,8 @@ function setBootStatus(message: string): void {
|
||||
document.getElementById('boot-status')!.textContent = message;
|
||||
}
|
||||
|
||||
setBootStatus('Starting frontend bundle...');
|
||||
|
||||
window.addEventListener('error', (event) => {
|
||||
setBootStatus(`Frontend error: ${event.message || 'unknown'}`);
|
||||
});
|
||||
@@ -16,11 +18,17 @@ window.addEventListener('unhandledrejection', (event) => {
|
||||
setBootStatus(`Frontend rejection: ${String(event.reason || 'unknown')}`);
|
||||
});
|
||||
|
||||
const bootTimeout = window.setTimeout(() => {
|
||||
setBootStatus('Bootstrap still running...');
|
||||
}, 3000);
|
||||
|
||||
bootstrapApplication(AppComponent, appConfig)
|
||||
.then(() => {
|
||||
window.clearTimeout(bootTimeout);
|
||||
document.getElementById('boot-status')?.remove();
|
||||
})
|
||||
.catch((err) => {
|
||||
window.clearTimeout(bootTimeout);
|
||||
console.error(err);
|
||||
setBootStatus(`Bootstrap failed: ${String(err)}`);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user