Fix: Loading screen now shows on every page load
Problems Fixed: 1. Blank white screen on initial load (loading screen had display:none) 2. Only showed once (sessionStorage.blazorLoaded prevented repeat shows) 3. Fast connections meant users never saw it Solution: 1. Removed display:none from HTML - screen visible immediately 2. Removed sessionStorage check - shows on every page load 3. Screen visible by default, hides when Blazor.start() completes Behavior Now: - Loading screen appears instantly (no blank white screen) - Shows on every page load (full page refresh) - Hides when SignalR connection established - Works correctly with slow/throttled connections 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
0a08d1a943
commit
5f71f0bb2d
@ -41,7 +41,7 @@
|
||||
</head>
|
||||
<body>
|
||||
<!-- PWA Loading Screen - Managed by blazor-integration.js -->
|
||||
<div id="pwa-loading-screen" class="pwa-loading-screen" style="display: none;">
|
||||
<div id="pwa-loading-screen" class="pwa-loading-screen">
|
||||
<div class="pwa-loading-content">
|
||||
<div class="pwa-loading-logo">
|
||||
<i class="fas fa-store"></i>
|
||||
|
||||
@ -2,20 +2,14 @@
|
||||
document.addEventListener('DOMContentLoaded', async function() {
|
||||
console.log('Blazor: DOM Content Loaded');
|
||||
|
||||
// Show loading screen initially (only on first load)
|
||||
const isFirstLoad = !sessionStorage.getItem('blazorLoaded');
|
||||
// Loading screen is visible by default (no display:none in HTML)
|
||||
// This eliminates the blank white screen on initial page load
|
||||
const loadingScreen = document.getElementById('pwa-loading-screen');
|
||||
|
||||
if (isFirstLoad && loadingScreen) {
|
||||
loadingScreen.style.display = 'flex';
|
||||
console.log('Blazor: Showing loading screen for first load');
|
||||
}
|
||||
console.log('Blazor: Loading screen visible, starting Blazor Server...');
|
||||
|
||||
// Blazor Server is available on all Admin pages, so always start it
|
||||
// The blazor.server.js script is already loaded in _Layout.cshtml
|
||||
try {
|
||||
console.log('Blazor: Starting Blazor Server...');
|
||||
|
||||
// Start Blazor Server with reconnection UI
|
||||
await Blazor.start({
|
||||
reconnectionOptions: {
|
||||
@ -34,10 +28,7 @@ document.addEventListener('DOMContentLoaded', async function() {
|
||||
}
|
||||
});
|
||||
|
||||
console.log('Blazor: Started successfully');
|
||||
|
||||
// Mark as loaded and hide loading screen
|
||||
sessionStorage.setItem('blazorLoaded', 'true');
|
||||
console.log('Blazor: Started successfully, hiding loading screen');
|
||||
hideLoadingScreen();
|
||||
|
||||
} catch (error) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user