You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In line 21 args.duration = args.duration ? args.duration : defaultDuration;
If duration is set to 0, args.duration equals defaultDuration and it violates the doc
duration - Optional. The duration (in milliseconds) of message. A duration of 0 will prevent messages from closing automatically.
The text was updated successfully, but these errors were encountered:
tandibar
added a commit
to tandibar/angular-notify
that referenced
this issue
Aug 16, 2016
Workaround - set duration to any non-empty string. Since 'string' > 0 === false, but 'string' is truthy, it will prevent the timeout code from being triggered.
This is by no means a good solution, but it's a workable temporary workaround.
If you want to take it one step further, you could patch this for your local project globally with the following interceptor (test before using! :) ):
angular.module('myApp').config(function ($provide) {
$provide.decorator('notify', function ($delegate) {
return function (args) {
if (typeof args !== 'object') {
return $delegate(args);
}
if (args.duration === 0) {
// Workaround
args.duration = 'never close';
}
return $delegate(args);
}
});
});
This will prevent things like notify.closeAll() from working, so beware!
In line 21
args.duration = args.duration ? args.duration : defaultDuration;
If duration is set to 0, args.duration equals defaultDuration and it violates the doc
The text was updated successfully, but these errors were encountered: