I am testing some error handling and for some reason my event handler is being called twice.
Anyone know why it is being called twice? I also tried putting the event handler on the view and router and I get the same result.
app.on('routerAjaxStart', function(xhr, options) {
console.log('ajax start');
console.log(xhr);
});
app.on('routerAjaxError', function(xhr, options) {
console.log('ajax error');
console.log(xhr);
app.dialog.alert('We we sorry but we ran into an error. Please try again later.');
});
app.on('routerAjaxComplete', function(xhr, options) {
console.log('ajax complete');
console.log(xhr);
});
I did some debugging and this is what I see in the console.
Interesting thing is the second Error event is being called after the Complete event.
Because it’s being called twice I’m getting two dialogs and only want one to show.
Thanks!
v5.3.0