mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-12-28 19:31:14 +08:00
Removed invalid Action.notificationDismissed firing
Summary: If a notification is dismissed manually, the setInterval dismissal is still fired. This patch adds a check and removes the notification dismissal action from firing Test Plan: none Reviewers: ktalwar, bengotow Reviewed By: bengotow Differential Revision: https://phab.nylas.com/D1218
This commit is contained in:
parent
af357ef005
commit
ac1ad67123
1 changed files with 5 additions and 1 deletions
|
@ -74,7 +74,8 @@ NotificationStore = Reflux.createStore
|
|||
@_notifications[notification.tag] = notification
|
||||
if notification.expiry?
|
||||
timeoutVal = Math.max(0, notification.expiry - Date.now())
|
||||
setTimeout(@_removeNotification(notification), timeoutVal)
|
||||
timeoutId = setTimeout(@_removeNotification(notification), timeoutVal)
|
||||
notification.timeoutId = timeoutId
|
||||
|
||||
@trigger()
|
||||
|
||||
|
@ -82,6 +83,9 @@ NotificationStore = Reflux.createStore
|
|||
# above in setTimeout()
|
||||
_removeNotification: (notification) -> =>
|
||||
console.log "Removed #{notification}" if VERBOSE
|
||||
|
||||
clearTimeout(notification.timeoutId) if notification.timeoutId
|
||||
|
||||
delete @_notifications[notification.tag]
|
||||
@trigger()
|
||||
|
||||
|
|
Loading…
Reference in a new issue