Skip to content

Commit

Permalink
Reset image position when onSwipeDown is undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhenjaHorbach committed Jun 12, 2024
1 parent ca69b0f commit 2e34376
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/components/ImageView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ function ImageView({isAuthTokenRequired = false, url, fileName, onError, onSwipe
if (dy >= maxTranslateY && scale.value === minScale) {
if (onSwipeDown) {
onSwipeDown();
} else {
translationY.value = withSpring(0, SPRING_CONFIG);
translationX.value = withSpring(0, SPRING_CONFIG);
}
} else if (scale.value === minScale) {
translationY.value = withSpring(0, SPRING_CONFIG);
Expand Down

0 comments on commit 2e34376

Please sign in to comment.