about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJustSNguyen <142023394+JustSNguyen@users.noreply.github.com>2024-11-12 01:33:47 +0700
committerGitHub <noreply@github.com>2024-11-11 18:33:47 +0000
commit2728de03d3d291762339bd9b3798e8c7b1b40d70 (patch)
treefb194b5bfb9792f5b0ae3fae71b40eac7e0ae3c1
parentb85a7da26b86691f3ed283b20aba9bc66cfacdf3 (diff)
downloadvoidsky-2728de03d3d291762339bd9b3798e8c7b1b40d70.tar.zst
Fix unscrollable body when returning to desktop mode from mobile mode with navigation drawer open. (#6201)
* fix: only lock body when drawer is opened and not in desktop mode

* Reuse variable

---------

Co-authored-by: Dan Abramov <dan.abramov@gmail.com>
-rw-r--r--src/view/shell/index.web.tsx5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/view/shell/index.web.tsx b/src/view/shell/index.web.tsx
index 84d6994b3..f55437356 100644
--- a/src/view/shell/index.web.tsx
+++ b/src/view/shell/index.web.tsx
@@ -32,8 +32,9 @@ function ShellInner() {
   const navigator = useNavigation<NavigationProp>()
   const closeAllActiveElements = useCloseAllActiveElements()
   const {_} = useLingui()
+  const showDrawer = !isDesktop && isDrawerOpen
 
-  useWebBodyScrollLock(isDrawerOpen)
+  useWebBodyScrollLock(showDrawer)
   useComposerKeyboardShortcut()
   useIntentHandler()
 
@@ -56,7 +57,7 @@ function ShellInner() {
       <Lightbox />
       <PortalOutlet />
 
-      {!isDesktop && isDrawerOpen && (
+      {showDrawer && (
         <TouchableWithoutFeedback
           onPress={ev => {
             // Only close if press happens outside of the drawer