fix: set body indent after navigation properly

This commit is contained in:
EnixCoda 2024-09-23 20:53:32 +08:00
parent 03e3454afc
commit 48499ed83d

View file

@ -269,7 +269,7 @@ function useUpdateBodyIndentAfterRedirect(update: (shouldExpand: boolean) => voi
const shouldExpand = getDerivedExpansion({ intelligentToggle, sidebarToggleMode })
update(shouldExpand)
// Below DOM mutation cannot be omitted, if do, body indent may get lost when shouldExpand is true for both before & after redirecting
DOMHelper.setBodyIndent(sidebarPlacement)
DOMHelper.setBodyIndent(shouldExpand && sidebarPlacement)
}
}, [update, sidebarToggleMode, intelligentToggle, sidebarPlacement]),
)