discourse/app/views/common/_discourse_javascript.html.erb

39 lines
1.0 KiB
Plaintext

<script>
Ember.RSVP.configure('onerror', function(e) {
// Ignore TransitionAborted exceptions that bubble up
if (e && e.message === "TransitionAborted") { return; }
<% if Rails.env.development? %>
if (e) {
if (e.message || e.stack) {
console.log(e.message);
console.log(e.stack);
} else {
console.log("Uncaught promise: ", e);
}
} else {
console.log("A promise failed but was not caught.");
}
<% end %>
window.onerror(e && e.message, null,null,null,e);
});
</script>
<script>
<%- if !current_user && flash[:authentication_data] %>
Discourse.showingSignup = true
require('discourse/routes/application').default.reopen({
actions: {
didTransition: function() {
Em.run.next(function(){
Discourse.authenticationComplete(<%=flash[:authentication_data].html_safe%>);
});
return this._super();
}
}
});
<%- end %>
</script>
<%= preload_script 'browser-update' %>