1
0
mirror of https://github.com/flarum/core.git synced 2025-10-11 23:14:29 +02:00

Improve client XHR error handling

The default XHR error handler produce an alert which is appropriate to the response status code. It can be overridden per-request (by specifying the `errorHandler` option) so that the alert can be suppressed or displayed in a different position (e.g. inside a modal).

ref #118
This commit is contained in:
Toby Zerner
2015-10-20 12:48:26 +10:30
parent 7490709af8
commit 26a821e3e2
26 changed files with 192 additions and 175 deletions

View File

@@ -128,7 +128,7 @@ export default class DiscussionPage extends Page {
// component for the first time on page load, then any calls to m.redraw
// will be ineffective and thus any configs (scroll code) will be run
// before stuff is drawn to the page.
setTimeout(this.show.bind(this, preloadedDiscussion));
setTimeout(this.show.bind(this, preloadedDiscussion), 0);
} else {
const params = this.requestParams();