Open denen99 opened 7 years ago
You probably want to update previous notification. please see the demo here.
Thanks but shouldnt the autoDismiss not require the removeNotification() to be called ?
Why do you want. removeNotification
to be called? Share the usecase.
In general we usually want to update previous notification. If previous notification was delayed to get closed by couple of second it would not be considered a big problem. The point is two notifications of same ID should not be shown simultaneously.
I guess i was just asking if autoDismiss should automatically called removeNotification and whether or not there was a potential race condition. We are seeing issues intermittently if we call Notifications.success() and then later call it again, we see the previous message stacked underneath again so it looks like a double notification.
Yes this is probably due to race condition. In my opinion redux based logic could have been improved. I don't understand why are we keeping all notifications in redux. We should have used redux just to send messages to React component and after message consumed we should have clear all notifications from the redux store. I have implemented this way and now not having this kind of issues. Here is my source code for better understanding. https://github.com/sheikhG1900/react-notifier-system-redux
I think i figured out whats going on. if i click an action, a message gets dispatched, but before the autoDismiss fires , I click to another page. The notification gets stuck in the store... Need to see how the autoDismiss logic is managed, i guess the setTimeout() is getting cancelled and the message is getting stuck.
https://github.com/igorprado/react-notification-system/blob/master/src/helpers.js#L15
Hi -
I have a situation where i call a Notifications.success() and the notifications state in redux (using autoDismiss) does not auto remove. This causes a double notification to show up when the next notification is triggered.
It doesnt happen every time but every so often i see this case. autoDismiss is set to 5 and the next event happens well after 5 seconds.
Any ideas ?