Fix: PWA loading screen now only shows on app startup, not on every navigation
Changed splash screen to use sessionStorage to detect first load vs navigation. - Loading screen hidden by default, only shown on initial app load - Uses sessionStorage flag to persist across navigation within same session - Prevents jarring loading screen on every page navigation - Updated hideLoadingScreen to use display:none instead of remove() 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -40,8 +40,8 @@
|
||||
@await RenderSectionAsync("Head", required: false)
|
||||
</head>
|
||||
<body>
|
||||
<!-- PWA Loading Screen -->
|
||||
<div id="pwa-loading-screen" class="pwa-loading-screen">
|
||||
<!-- PWA Loading Screen - Only on first load -->
|
||||
<div id="pwa-loading-screen" class="pwa-loading-screen" style="display: none;">
|
||||
<div class="pwa-loading-content">
|
||||
<div class="pwa-loading-logo">
|
||||
<i class="fas fa-store"></i>
|
||||
@@ -56,6 +56,21 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// Show loading screen only on initial app load, not on navigation
|
||||
(function() {
|
||||
const isFirstLoad = !sessionStorage.getItem('appLoaded');
|
||||
|
||||
if (isFirstLoad) {
|
||||
const loadingScreen = document.getElementById('pwa-loading-screen');
|
||||
if (loadingScreen) {
|
||||
loadingScreen.style.display = 'flex';
|
||||
}
|
||||
sessionStorage.setItem('appLoaded', 'true');
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
|
||||
<header>
|
||||
<nav class="navbar navbar-expand-sm navbar-light bg-white">
|
||||
<div class="container-fluid">
|
||||
|
||||
Reference in New Issue
Block a user