1
0
mirror of https://github.com/flarum/core.git synced 2025-10-12 15:34:26 +02:00

Remove the "debug" button from request error alerts

Using the browser's console to debug failed requests is much more powerful
This commit is contained in:
Toby Zerner
2018-09-21 14:27:39 +09:30
parent 5ce702a5d0
commit 64686ef7a9
3 changed files with 1 additions and 48 deletions

View File

@@ -1,30 +0,0 @@
import Modal from './Modal';
export default class RequestErrorModal extends Modal {
className() {
return 'RequestErrorModal Modal--large';
}
title() {
return this.props.error.xhr
? this.props.error.xhr.status+' '+this.props.error.xhr.statusText
: '';
}
content() {
let responseText;
try {
responseText = JSON.stringify(JSON.parse(this.props.error.responseText), null, 2);
} catch (e) {
responseText = this.props.error.responseText;
}
return <div className="Modal-body">
<pre>
{this.props.error.options.method} {this.props.error.options.url}<br/><br/>
{responseText}
</pre>
</div>;
}
}