Skip to content

Commit

Permalink
Fix web crash (#7426)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon authored Jan 10, 2025
1 parent 6ca9740 commit 08c6ac7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/interstitials/Trending.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion src/view/com/pager/Pager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 08c6ac7

Please sign in to comment.