From 48499ed83d3f7b032c1e7fdb769855015da45db3 Mon Sep 17 00:00:00 2001 From: EnixCoda Date: Mon, 23 Sep 2024 20:53:32 +0800 Subject: [PATCH] fix: set body indent after navigation properly --- src/components/SideBar.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/SideBar.tsx b/src/components/SideBar.tsx index f711c00..070973b 100644 --- a/src/components/SideBar.tsx +++ b/src/components/SideBar.tsx @@ -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]), )