Skip to content

Commit 73c53ad

Browse files
author
Manu
committed
- v0.0.11
1 parent 9036ab9 commit 73c53ad

3 files changed

Lines changed: 12 additions & 8 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

index.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff 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
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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": {

0 commit comments

Comments
 (0)