mirror of
https://github.com/flarum/core.git
synced 2025-10-10 22:44:25 +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:
@@ -36,7 +36,8 @@ export default class ReplyComposer extends ComposerBody {
|
||||
|
||||
items.add('title', (
|
||||
<h3>
|
||||
{icon('reply')}{' '}<a href={app.route.discussion(discussion)} config={m.route}>{discussion.title()}</a>
|
||||
{icon('reply')} {' '}
|
||||
<a href={app.route.discussion(discussion)} config={m.route}>{discussion.title()}</a>
|
||||
</h3>
|
||||
));
|
||||
|
||||
@@ -93,11 +94,7 @@ export default class ReplyComposer extends ComposerBody {
|
||||
|
||||
app.composer.hide();
|
||||
},
|
||||
response => {
|
||||
this.loading = false;
|
||||
m.redraw();
|
||||
app.alertErrors(response.errors);
|
||||
}
|
||||
this.loaded.bind(this)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user