From f5d8bb7cbe7bca3cb4bbc102a3959823b51c72f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Tue, 14 Sep 2021 18:15:27 +0200 Subject: [PATCH] Remove awaiting setState() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/components/views/elements/ImageView.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/views/elements/ImageView.tsx b/src/components/views/elements/ImageView.tsx index eedf492e1f..362d1c7da9 100644 --- a/src/components/views/elements/ImageView.tsx +++ b/src/components/views/elements/ImageView.tsx @@ -140,12 +140,12 @@ export default class ImageView extends React.Component { this.image.current.removeEventListener("load", this.imageLoaded); } - private imageLoaded = async () => { + private imageLoaded = () => { // First, we calculate the zoom, so that the image has the same size as // the thumbnail const { thumbnailInfo } = this.props; if (thumbnailInfo?.width) { - await this.setState({ zoom: thumbnailInfo.width / this.image.current.naturalWidth }); + this.setState({ zoom: thumbnailInfo.width / this.image.current.naturalWidth }); } // Once the zoom is set, we the image is considered loaded and we can @@ -153,7 +153,7 @@ export default class ImageView extends React.Component { this.imageIsLoaded = true; this.animatingLoading = true; this.setZoomAndRotation(); - await this.setState({ + this.setState({ translationX: 0, translationY: 0, });