fix: iOS 26 troubleshooting 1.0

This commit is contained in:
Eric Gullickson
2025-12-27 20:29:25 -06:00
parent 69171f7778
commit e65669fede
2 changed files with 36 additions and 5 deletions

View File

@@ -6,6 +6,34 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="color-scheme" content="light dark">
<title>MotoVaultPro</title>
<!-- Dark mode initialization - MUST run before any other scripts -->
<!-- This prevents iOS 26 Safari from overriding our dark mode preference -->
<script>
(function() {
try {
const stored = localStorage.getItem('motovaultpro-mobile-settings');
const settings = stored ? JSON.parse(stored) : {};
// Check user preference, fall back to system preference
const prefersDark = settings.darkMode !== undefined
? settings.darkMode
: window.matchMedia('(prefers-color-scheme: dark)').matches;
if (prefersDark) {
document.documentElement.classList.add('dark');
} else {
document.documentElement.classList.remove('dark');
}
} catch (e) {
// Fallback to system preference on error
if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
document.documentElement.classList.add('dark');
}
}
})();
</script>
<!-- Runtime config MUST load synchronously before any module scripts -->
<script src="/config.js"></script>
</head>