Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Unable to close a noty that is opening #210

Closed
lgm42 opened this Issue · 6 comments

3 participants

@lgm42

I launch an async task to do.
Before making it I call

var n = noty({text: "test", timeout:4000,  layout:defaultNotyLayout, type:'information' });

At the end of the async task i call

n.close();

But sometimes my task take a very little time and the noty is not fully loaded before receiving close action and the noty don't close.

I watch the code and I see the use of queue() method that ask a self.close method. Great !

But when I go in debug I see that close method was put in the queue after the timeout method.
In debug I call the method : self.$bar.queue() just after applying queue method in the close() method and I get this values :

["inprogress", function (b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}}, function () {
                  self.close.apply(self);
                }]
@lgm42

no idea ?

@Aphax

Hi,

I was in the same situation, in case you haven't figured out a solution, I've found this one :

n.close();
if(n.showing)
  n.$bar.dequeue();

If noty is performing a showing method (the one who creates the conflict), it will force noty to go directly to the next queue call, who is the closing one.

Hope this help !

@lgm42

Thanks A lot I'll make a try immediately !

@needim needim closed this
@lgm42

It is not possible to make a correction directly in the library ? Because it's very boring to insert that piece of code each time I make a noty ....

@needim needim referenced this issue from a commit
@needim Resolve #210 #204 a890c54
@needim
Owner

Hi, can you try v2.2.8. I think its ok now.

@lgm42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.