From b216e4dc3bc6fdc272088bf17f9143d434afaf5c Mon Sep 17 00:00:00 2001 From: Alex Beaman Date: Wed, 3 Aug 2022 12:49:22 +0200 Subject: [PATCH] Prefer early return --- src/components/OpacityView.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/OpacityView.js b/src/components/OpacityView.js index 867d936631e8..9b6ebcc018b4 100644 --- a/src/components/OpacityView.js +++ b/src/components/OpacityView.js @@ -47,9 +47,10 @@ class OpacityView extends React.Component { // If animation doesn't finish because Animation.stop was called // (e.g. because it was interrupted by a gesture or another animation), // restart animation so we always make sure the component gets completely shown. - if (!finished) { - this.undim(); + if (finished) { + return; } + this.undim(); }); }