Bug fix
This commit is contained in:
fraxle
2026-05-25 11:27:32 +01:00
parent 2f76f98632
commit 9bb972521f
+6 -1
View File
@@ -253,9 +253,14 @@ export function useAppState() {
try {
const saved = localStorage.getItem('sunscope_utci_env');
if (saved && UTCI_ENVIRONMENTS[saved]) return saved;
// No saved env - derive from the saved variant if it has a default.
// No saved env - derive from the saved variant only when the outdoors
// profile is active. Other profiles (Basic, Vehicle etc.) always open.
const savedProfile = localStorage.getItem('sunscope_profile') || 'basic';
if (savedProfile === 'outdoors') {
const savedVariant = localStorage.getItem('sunscope_outdoors_variant') || '';
return VARIANT_DEFAULT_ENV[savedVariant] ?? 'open';
}
return 'open';
} catch (e) { return 'open'; }
});
const setUtciEnvAndSave = (v) => {