Fix: Loading screen now waits for Blazor.start() on all pages
Problem: - Loading screen was hiding immediately without waiting for Blazor - Page detection logic was too restrictive (only /blazor paths) - Most admin pages don't have Blazor components, so screen hid instantly Solution: - Blazor Server is loaded on ALL admin pages via _Layout.cshtml - Removed restrictive path checking (was checking for /blazor or components) - Now always calls Blazor.start() and waits for SignalR connection - Loading screen properly shows while SignalR establishes connection Expected behavior: - First load: Screen shows → Blazor connects → Screen fades out - Console: "Starting Blazor Server..." → "Started successfully" → "Hiding" 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
db2443c7ac
commit
0a08d1a943
@ -11,10 +11,8 @@ document.addEventListener('DOMContentLoaded', async function() {
|
|||||||
console.log('Blazor: Showing loading screen for first load');
|
console.log('Blazor: Showing loading screen for first load');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if we're on a page that should use Blazor
|
// Blazor Server is available on all Admin pages, so always start it
|
||||||
const blazorContainers = document.querySelectorAll('[data-blazor-component]');
|
// The blazor.server.js script is already loaded in _Layout.cshtml
|
||||||
|
|
||||||
if (blazorContainers.length > 0 || window.location.pathname.includes('/Admin/Products/Blazor') || window.location.pathname.includes('/blazor')) {
|
|
||||||
try {
|
try {
|
||||||
console.log('Blazor: Starting Blazor Server...');
|
console.log('Blazor: Starting Blazor Server...');
|
||||||
|
|
||||||
@ -46,10 +44,6 @@ document.addEventListener('DOMContentLoaded', async function() {
|
|||||||
console.error('Blazor: Failed to start:', error);
|
console.error('Blazor: Failed to start:', error);
|
||||||
hideLoadingScreen();
|
hideLoadingScreen();
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
// Not a Blazor page, hide loading screen immediately
|
|
||||||
hideLoadingScreen();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Loading screen management
|
// Loading screen management
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user