File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -32,12 +32,18 @@ class ProgressBar extends React.Component {
32
32
if ( this . interval ) {
33
33
clearInterval ( this . interval ) ;
34
34
}
35
+ if ( this . timeout ) {
36
+ clearTimeout ( this . timeout ) ;
37
+ }
35
38
} ;
36
39
37
40
componentWillReceiveProps = ( nextProps ) => {
38
41
if ( this . interval ) {
39
42
clearInterval ( this . interval ) ;
40
43
}
44
+ if ( this . timeout ) {
45
+ clearTimeout ( this . timeout ) ;
46
+ }
41
47
42
48
if ( nextProps . autoIncrement && nextProps . percent >= 0 && nextProps . percent < 99 ) {
43
49
this . interval = setInterval ( this . increment , nextProps . intervalTime ) ;
@@ -47,7 +53,7 @@ class ProgressBar extends React.Component {
47
53
this . setState ( {
48
54
percent : 99.9
49
55
} , ( ) => {
50
- setTimeout ( ( ) => {
56
+ this . timeout = setTimeout ( ( ) => {
51
57
this . setState ( {
52
58
percent : - 1
53
59
} ) ;
You can’t perform that action at this time.
0 commit comments