mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-06 00:27:24 +00:00
Give useIsMobile an initial state
This commit is contained in:
4 files changed
+20
-39
No files matched your search
@@ -48,13 +48,7 @@ export function SettingsLayout() {
|
||||
const projectsManager = useProjectsManager();
|
||||
|
||||
const [_projects, setProjects] = useState<Project[]>([]);
|
||||
const [isSidebarVisible, setIsSidebarVisible] = useState(() => {
|
||||
// On mobile, always start hidden
|
||||
if (typeof window !== 'undefined' && window.innerWidth < 768) {
|
||||
return false;
|
||||
}
|
||||
return false; // Default to closed initially
|
||||
});
|
||||
const [isSidebarVisible, setIsSidebarVisible] = useState(!isMobile);
|
||||
const [hasSetInitialState, setHasSetInitialState] = useState(false);
|
||||
|
||||
const loadProjects = useCallback(async () => {
|
||||
|
||||
Reference in new issue
Block a user