File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -132,5 +132,5 @@ npm install --save jquery
132132[ CHANGELOG ] : ./CHANGELOG.md
133133
134134[ LICENSE ] : ./LICENSE.md
135- [ version-badge ] : https://img.shields.io/badge/version-0.0.10 -blue.svg
135+ [ version-badge ] : https://img.shields.io/badge/version-0.0.11 -blue.svg
136136[ license-badge ] : https://img.shields.io/badge/license-MIT-blue.svg
Original file line number Diff line number Diff line change @@ -10,16 +10,16 @@ class NotificationAlert extends React.Component {
1010 notifyTR : [ ] ,
1111 notifyBL : [ ] ,
1212 notifyBC : [ ] ,
13- notifyBR : [ ]
13+ notifyBR : [ ] ,
14+ notifyID : [ ]
1415 } ;
1516 this . onDismiss = this . onDismiss . bind ( this ) ;
1617 this . notificationAlert = this . notificationAlert . bind ( this ) ;
1718 }
1819 // to stop the warning of calling setState of unmounted component
1920 componentWillUnmount ( ) {
20- var id = window . setTimeout ( null , 0 ) ;
21- while ( id -- ) {
22- window . clearTimeout ( id ) ;
21+ for ( let i = 0 ; i < this . state . notifyID . length ; i ++ ) {
22+ window . clearTimeout ( this . state . notifyID [ i ] ) ;
2323 }
2424 }
2525 onDismiss ( nNumber , place , noAnimate ) {
@@ -66,7 +66,9 @@ class NotificationAlert extends React.Component {
6666 } . bind ( this ) ,
6767 800
6868 ) ;
69- console . log ( id ) ;
69+ this . setState ( {
70+ notifyID : [ id ] . concat ( this . state . notifyID )
71+ } )
7072 }
7173 sNotify = { } ;
7274 sNotify [ "notify" + place . toUpperCase ( ) ] = notify ;
@@ -117,7 +119,9 @@ class NotificationAlert extends React.Component {
117119 } . bind ( this ) ,
118120 options . autoDismiss * 1000 + ( notify . length - 1 ) * 1000
119121 ) ;
120- console . log ( id ) ;
122+ this . setState ( {
123+ notifyID : [ id ] . concat ( this . state . notifyID )
124+ } )
121125 }
122126 this . setState ( sNotify ) ;
123127 }
Original file line number Diff line number Diff line change 11{
22 "name" : " react-notification-alert" ,
3- "version" : " 0.0.10 " ,
3+ "version" : " 0.0.11 " ,
44 "description" : " React bootstrap 4 notification alert" ,
55 "main" : " dist/index.js" ,
66 "scripts" : {
You can’t perform that action at this time.
0 commit comments