Skip to content

Commit ecea94a

Browse files
authored
You already pass the tag
You already pass the tag no reason for what you had there
1 parent e7ea1d5 commit ecea94a

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
@@ -118,7 +118,7 @@ class Notification extends React.Component {
118118
n.onshow = (e) => {
119119
this.props.onShow(e, opt.tag);
120120
setTimeout(() => {
121-
this.close(opt.tag);
121+
this.close(n);
122122
}, this.props.timeout);
123123
};
124124
n.onclick = (e) => {this.props.onClick(e, opt.tag); };
@@ -136,9 +136,9 @@ class Notification extends React.Component {
136136
);
137137
}
138138

139-
close(tag) {
140-
if (this.notifications[tag] && typeof this.notifications[tag].close === 'function') {
141-
this.notifications[tag].close();
139+
close(n) {
140+
if (n && typeof n.close === 'function') {
141+
n.close();
142142
}
143143
}
144144

0 commit comments

Comments
 (0)