diff --git a/src/components/views/dialogs/BugReportDialog.js b/src/components/views/dialogs/BugReportDialog.js index ccb332fa60..fe95041373 100644 --- a/src/components/views/dialogs/BugReportDialog.js +++ b/src/components/views/dialogs/BugReportDialog.js @@ -23,6 +23,7 @@ import * as sdk from '../../../index'; import SdkConfig from '../../../SdkConfig'; import Modal from '../../../Modal'; import { _t } from '../../../languageHandler'; +import sendBugReport from '../../../rageshake/submit-rageshake'; export default class BugReportDialog extends React.Component { constructor(props) { @@ -67,32 +68,30 @@ export default class BugReportDialog extends React.Component { this.setState({ busy: true, progress: null, err: null }); this._sendProgressCallback(_t("Preparing to send logs")); - require(['../../../rageshake/submit-rageshake'], (s) => { - s(SdkConfig.get().bug_report_endpoint_url, { - userText, - sendLogs: true, - progressCallback: this._sendProgressCallback, - label: this.props.label, - }).then(() => { - if (!this._unmounted) { - this.props.onFinished(false); - const QuestionDialog = sdk.getComponent("dialogs.QuestionDialog"); - // N.B. first param is passed to piwik and so doesn't want i18n - Modal.createTrackedDialog('Bug report sent', '', QuestionDialog, { - title: _t('Logs sent'), - description: _t('Thank you!'), - hasCancelButton: false, - }); - } - }, (err) => { - if (!this._unmounted) { - this.setState({ - busy: false, - progress: null, - err: _t("Failed to send logs: ") + `${err.message}`, - }); - } - }); + sendBugReport(SdkConfig.get().bug_report_endpoint_url, { + userText, + sendLogs: true, + progressCallback: this._sendProgressCallback, + label: this.props.label, + }).then(() => { + if (!this._unmounted) { + this.props.onFinished(false); + const QuestionDialog = sdk.getComponent("dialogs.QuestionDialog"); + // N.B. first param is passed to piwik and so doesn't want i18n + Modal.createTrackedDialog('Bug report sent', '', QuestionDialog, { + title: _t('Logs sent'), + description: _t('Thank you!'), + hasCancelButton: false, + }); + } + }, (err) => { + if (!this._unmounted) { + this.setState({ + busy: false, + progress: null, + err: _t("Failed to send logs: ") + `${err.message}`, + }); + } }); }