diff --git a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/layout-main.tsx b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/layout-main.tsx index 801d6cfd47..9f828c9001 100644 --- a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/layout-main.tsx +++ b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/layout-main.tsx @@ -99,14 +99,14 @@ const AppDetailLayout: FC = (props) => { useEffect(() => { if (!appDetail) return - const localeMode = localStorage.getItem('app-detail-collapse-or-expand') || 'expand' - setAppSidebarExpand(localeMode) - }, [appDetail, setAppSidebarExpand]) - - useEffect(() => { - if (isMobile) + if (isMobile) { setAppSidebarExpand('collapse') - }, [isMobile, setAppSidebarExpand]) + } + else { + const localeMode = localStorage.getItem('app-detail-collapse-or-expand') || 'expand' + setAppSidebarExpand(localeMode) + } + }, [appDetail, isMobile, setAppSidebarExpand]) useEffect(() => { if (!appDetail || isLoadingCurrentWorkspace)