mirror of
https://github.com/flarum/framework.git
synced 2025-06-19 16:51:23 +08: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:
@ -1,9 +1,7 @@
|
||||
import ItemList from './utils/ItemList';
|
||||
import Alert from './components/Alert';
|
||||
import Button from './components/Button';
|
||||
import ModalManager from './components/ModalManager';
|
||||
import AlertManager from './components/AlertManager';
|
||||
import RequestErrorModal from './components/RequestErrorModal';
|
||||
import Translator from './Translator';
|
||||
import Store from './Store';
|
||||
import Session from './Session';
|
||||
@ -333,10 +331,7 @@ export default class Application {
|
||||
|
||||
error.alert = new Alert({
|
||||
type: 'error',
|
||||
children,
|
||||
controls: app.forum.attribute('debug') ? [
|
||||
<Button className="Button Button--link" onclick={this.showDebug.bind(this, error)}>Debug</Button>
|
||||
] : undefined
|
||||
children
|
||||
});
|
||||
|
||||
try {
|
||||
@ -351,16 +346,6 @@ export default class Application {
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {RequestError} error
|
||||
* @private
|
||||
*/
|
||||
showDebug(error) {
|
||||
this.alerts.dismiss(this.requestErrorAlert);
|
||||
|
||||
this.modal.show(new RequestErrorModal({error}));
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a URL to the route with the given name.
|
||||
*
|
||||
|
Reference in New Issue
Block a user