-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Notifications may remain opened or dismiss immediately without showing #17
Comments
What might theoretically be, is that: notifyInterval = $interval(func, FADE_INTERVAL); (line:285) is invoked multiple times overriding the value of |
The workaround might be like this (piece of doFade func): var doFade = function(mode, opacity, duration, callback) {
var gap = FADE_INTERVAL / duration;
notifyScope.ngNotify.notifyStyle = {
display: 'block',
opacity: opacity
};
var func = function() {
opacity += mode * gap;
notifyScope.ngNotify.notifyStyle.opacity = opacity;
if (opacity <= OPACITY_MIN || OPACITY_MAX <= opacity) {
callback();
}
};
var iterations = 0;
if (mode>0)
{
iterations = Math.ceil((OPACITY_MAX - opacity) / gap);
} else{
iterations = Math.ceil((opacity - OPACITY_MIN) / gap)
}
notifyInterval = $interval(func, FADE_INTERVAL, iterations); Idea is to calc the number of iterations required to achieve min/max opacity. Math.ceil will ensure it will be achieved, always rounding to higher integer. And actual func() won't cancel any promises, but will only notify callback. It will be better to count iterations in func and call calback on the last invocation, but I tried to make changes as small as possible. Rest is for You to decide. It doesn't solve the problem of multiple invocations of $interval, but still solves the bug with constantly hidden or constantly visible notifications. I've tested on my server and it works now. |
Hey there @nzamosenchuk and @droritos, sorry for the delay, it's been crazy busy lately. I was also able to replicate the issue you're both seeing by clicking the "x" on a sticky notification multiple times before it disappeared. I've added an update that seems to have resolved the issue, a check to make sure we don't overwrite any currently running intervals without canceling them out. Give it a look and let me know if you're still running into any issues. Thanks for your help, it's much appreciated!! |
Gonna go ahead and close this guy. Let me know if you continue to see anything. Thanks! |
I had issue where |
Update: The opacity bug is fixed but some sticky notification do not get dismissed when .dismiss() is called. |
Notifications may remain opened or dismiss immediately without showing. I'm still investigating those two problems. But, so far can provide such details:
Usecase:
It's very hard to reproduce when starting a 'grunt serve', but in production environment it is easily reproducible.
The text was updated successfully, but these errors were encountered: