From 6be363d65453392fc9ce68de02c71be7a7bd4e66 Mon Sep 17 00:00:00 2001 From: Mustafa Buyukcelebi Date: Fri, 28 Dec 2018 15:33:00 +0300 Subject: [PATCH] Fixed run only once issue --- .../pinAnimatedInput/views/pinAnimatedInputView.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/pinAnimatedInput/views/pinAnimatedInputView.js b/src/components/pinAnimatedInput/views/pinAnimatedInputView.js index cd70d871c..3ff0e14f4 100644 --- a/src/components/pinAnimatedInput/views/pinAnimatedInputView.js +++ b/src/components/pinAnimatedInput/views/pinAnimatedInputView.js @@ -34,7 +34,6 @@ class PinAnimatedInput extends PureComponent { } _startLoadingAnimation = () => { - const { loading } = this.props; [...Array(4)].map((item, index) => { this.dots[index].setValue(0); }); @@ -44,8 +43,10 @@ class PinAnimatedInput extends PureComponent { duration: 250, easing: Easing.linear, })), - ]).start(() => { - if (loading) this._startLoadingAnimation(); + ]).start((o) => { + if (o.finished) { + this._startLoadingAnimation(); + } }); };