1
0
mirror of https://github.com/flarum/core.git synced 2025-08-04 15:37:51 +02:00

lint code

This commit is contained in:
David Sevilla Martin
2020-04-20 16:51:44 -04:00
parent 2c2f6fd4ed
commit 91522f84c5

View File

@@ -1,32 +1,32 @@
import Modal from './Modal'; import Modal from './Modal';
export default class RequestErrorModal extends Modal { export default class RequestErrorModal extends Modal {
className() { className() {
return 'RequestErrorModal Modal--large'; 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 ( title() {
<div className="Modal-body"> return this.props.error.xhr ? this.props.error.xhr.status + ' ' + this.props.error.xhr.statusText : '';
<pre> }
{this.props.error.options.method} {this.props.error.options.url}
<br /> content() {
<br /> let responseText;
{responseText}
</pre> try {
</div> 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>
);
}
} }