mirror of
https://github.com/langgenius/dify.git
synced 2026-05-09 21:28:25 +08:00
fix: restore mobile sidebar collapse behavior after appDetail loads
Merge the two sidebar useEffects to prevent race condition where appDetail loading could override the mobile collapse state. Now mobile always collapses regardless of when appDetail resolves.
This commit is contained in:
parent
1fe46ce0b8
commit
23f1adc833
@ -99,14 +99,14 @@ const AppDetailLayout: FC<IAppDetailLayoutProps> = (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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user