1.9.1
Bug fix
This commit is contained in:
@@ -253,9 +253,14 @@ export function useAppState() {
|
|||||||
try {
|
try {
|
||||||
const saved = localStorage.getItem('sunscope_utci_env');
|
const saved = localStorage.getItem('sunscope_utci_env');
|
||||||
if (saved && UTCI_ENVIRONMENTS[saved]) return saved;
|
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
|
||||||
const savedVariant = localStorage.getItem('sunscope_outdoors_variant') || '';
|
// profile is active. Other profiles (Basic, Vehicle etc.) always open.
|
||||||
return VARIANT_DEFAULT_ENV[savedVariant] ?? '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'; }
|
} catch (e) { return 'open'; }
|
||||||
});
|
});
|
||||||
const setUtciEnvAndSave = (v) => {
|
const setUtciEnvAndSave = (v) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user