Skip to content

Commit 133b74a

Browse files
authored
Merge pull request #21 from yanivkalfa/patch-2
You already pass the tag
2 parents 106df53 + ecea94a commit 133b74a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/components/Notification.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ class Notification extends React.Component {
116116
n.onshow = (e) => {
117117
this.props.onShow(e, opt.tag);
118118
setTimeout(() => {
119-
this.close(opt.tag);
119+
this.close(n);
120120
}, this.props.timeout);
121121
};
122122
n.onclick = (e) => {this.props.onClick(e, opt.tag); };
@@ -134,9 +134,9 @@ class Notification extends React.Component {
134134
);
135135
}
136136

137-
close(tag) {
138-
if (this.notifications[tag] && typeof this.notifications[tag].close === 'function') {
139-
this.notifications[tag].close();
137+
close(n) {
138+
if (n && typeof n.close === 'function') {
139+
n.close();
140140
}
141141
}
142142

0 commit comments

Comments
 (0)