Skip to content

Commit

Permalink
fix: clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
tienifr committed Jan 22, 2024
1 parent f2324c2 commit 13c2a36
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/ImageView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ function ImageView({isAuthTokenRequired = false, url, fileName, onError}: ImageV

const onContainerPress = (e?: GestureResponderEvent | KeyboardEvent | SyntheticEvent<Element, PointerEvent>) => {
if (!isZoomed && !isDragging) {
if (e && 'nativeEvent' in e && 'offsetX' in e.nativeEvent) {
if (e && 'nativeEvent' in e && e.nativeEvent instanceof PointerEvent) {
const {offsetX, offsetY} = e.nativeEvent;

// Dividing clicked positions by the zoom scale to get coordinates
Expand Down

0 comments on commit 13c2a36

Please sign in to comment.