Skip to content

Commit

Permalink
Merge pull request #33383 from mkhutornyi/fix-crash-pdf-android
Browse files Browse the repository at this point in the history
fix crash when trying to scroll pdf preview
  • Loading branch information
srikarparsi authored Dec 21, 2023
2 parents 3ab2de7 + 41ba476 commit 5715b54
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function BaseAttachmentViewPdf({
onScaleChangedProp(scale);

// When a pdf is shown in a carousel, we want to disable the pager scroll when the pdf is zoomed in
if (isUsedInCarousel) {
if (isUsedInCarousel && attachmentCarouselPagerContext) {
const shouldPagerScroll = scale === 1;

attachmentCarouselPagerContext.onPinchGestureChange(!shouldPagerScroll);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function AttachmentViewPdf(props) {
const Pan = Gesture.Pan()
.manualActivation(true)
.onTouchesMove((evt) => {
if (offsetX.value !== 0 && offsetY.value !== 0) {
if (offsetX.value !== 0 && offsetY.value !== 0 && attachmentCarouselPagerContext) {
// if the value of X is greater than Y and the pdf is not zoomed in,
// enable the pager scroll so that the user
// can swipe to the next attachment otherwise disable it.
Expand Down

0 comments on commit 5715b54

Please sign in to comment.