JanStevens / angular-growl-2

growl-like notifications for angularJS projects
MIT License
285 stars 97 forks source link

onlyUniqueMessages gets tripped up by rapidly triggered notifications #22

Closed soumya92 closed 10 years ago

soumya92 commented 10 years ago

Since the check for unique messages is in the main event loop, but the actual addition of the message is in a $timeout(...), sometimes I have as many as three of the same message get added to the list, since the first two $timeouts(...) did not trigger in time.

I'm not sure why there is a $timeout(...) in addMessage to begin with, but if there's a reason for it, then should the check for uniqueMessages be moved to within addMessage itself?