Use typeof to check for presence of parameters

Signed-off-by: Robin Townsend <robin@robin.town>
pull/21833/head
Robin Townsend 2021-07-22 09:41:39 -04:00
parent 3bf742f7aa
commit b99a6a8d54
1 changed files with 1 additions and 1 deletions

View File

@ -175,7 +175,7 @@ export default class ImageView extends React.Component<IProps, IState> {
translationX: 0,
translationY: 0,
});
} else if (zoomX === undefined && zoomY === undefined) {
} else if (typeof zoomX !== "number" && typeof zoomY !== "number") {
// Zoom relative to the center of the view
this.setState({
zoom: newZoom,