File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -90,8 +90,15 @@ export default class Countdown extends PureComponent {
9090 handleNetworkConnectivityChange = isConnected => this . setState ( { isConnected } ) ;
9191
9292 startCountdown = ( ) => {
93- if ( this . state . status === CountdownStatus . Counting ) return ;
94- this . handlePress ( ) ;
93+ const { onNetworkFailed } = this . props ;
94+ const { status, isConnected } = this . state ;
95+ if ( status === CountdownStatus . Counting ) return ;
96+
97+ if ( isConnected ) {
98+ this . setState ( { status : CountdownStatus . Counting } , this . startTimer ) ;
99+ } else {
100+ onNetworkFailed && onNetworkFailed ( ) ;
101+ }
95102 }
96103
97104 stopCountdown = ( ) => {
Original file line number Diff line number Diff line change 11{
22 "name" : " rn-countdown" ,
3- "version" : " 0.2.0 " ,
3+ "version" : " 0.2.1 " ,
44 "description" : " A smart countdown component for react-native apps. You may use it to handle different status when request a verification code." ,
55 "main" : " index.js" ,
66 "scripts" : {
You can’t perform that action at this time.
0 commit comments