fix(preferences_wrapper): issue with null shown status

This commit is contained in:
alexsparkes
2024-12-12 20:56:42 +00:00
parent 1f62ea966c
commit bad65cfe10
2 changed files with 6 additions and 3 deletions

View File

@@ -27,6 +27,7 @@
z-index: -2;
transition-timing-function: ease-in;
border-radius: map-get($modal, 'border-radius');
-webkit-user-select: none;
user-select: none;
overflow-y: auto;
transform: scale(0);
@@ -37,6 +38,7 @@
}
.modalInfoPage {
-webkit-user-select: text;
user-select: text;
}
}

View File

@@ -11,7 +11,8 @@ const PreferencesWrapper = ({ children, ...props }) => {
if (!props.setting) {
return true;
}
return localStorage.getItem(props.setting) === 'true' || props.default || false;
const storedValue = localStorage.getItem(props.setting);
return storedValue !== null ? storedValue === 'true' : props.default || false;
});
useEffect(() => {
@@ -30,8 +31,8 @@ const PreferencesWrapper = ({ children, ...props }) => {
return (
<div
className={`preferences transition-opacity duration-700 ease-in-out ${
shown ? 'opacity-100 pointer-events-auto' : 'opacity-50 pointer-events-none'
className={`preferences transition-all duration-1000 delay-75 ease-cubic ${
shown ? 'opacity-100 pointer-events-auto' : 'opacity-40 pointer-events-none'
} bg-modal-content-light dark:bg-modal-content-dark p-10 rounded`}
>
{props.zoomSetting && (