about summary refs log tree commit diff
diff options
context:
space:
mode:
authordan <dan.abramov@gmail.com>2025-01-10 20:39:22 +0000
committerGitHub <noreply@github.com>2025-01-10 20:39:22 +0000
commit08c6ac7c89ff47812cc2ee8fe69eb42d0118eadf (patch)
tree0cc105b15e1dbc37755d309981a5a3368bf46a77
parent6ca97406c1e1f2df6d39694dd1616d9abe081baa (diff)
downloadvoidsky-08c6ac7c89ff47812cc2ee8fe69eb42d0118eadf.tar.zst
Fix web crash (#7426)
-rw-r--r--src/components/interstitials/Trending.tsx2
-rw-r--r--src/view/com/pager/Pager.tsx2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/components/interstitials/Trending.tsx b/src/components/interstitials/Trending.tsx
index 82ca6d234..a9d7778a9 100644
--- a/src/components/interstitials/Trending.tsx
+++ b/src/components/interstitials/Trending.tsx
@@ -41,7 +41,7 @@ export function Inner() {
     setTrendingDisabled(true)
   }, [setTrendingDisabled])
 
-  const drawerGesture = useContext(DrawerGestureContext)!
+  const drawerGesture = useContext(DrawerGestureContext) ?? Gesture.Native() // noop for web
   const trendingScrollGesture =
     Gesture.Native().blocksExternalGesture(drawerGesture)
 
diff --git a/src/view/com/pager/Pager.tsx b/src/view/com/pager/Pager.tsx
index 2c0bbee52..f62bffc53 100644
--- a/src/view/com/pager/Pager.tsx
+++ b/src/view/com/pager/Pager.tsx
@@ -130,7 +130,7 @@ export const Pager = forwardRef<PagerRef, React.PropsWithChildren<Props>>(
       [parentOnPageScrollStateChanged],
     )
 
-    const drawerGesture = useContext(DrawerGestureContext)!
+    const drawerGesture = useContext(DrawerGestureContext) ?? Gesture.Native() // noop for web
     const nativeGesture =
       Gesture.Native().requireExternalGestureToFail(drawerGesture)