From 269f9a5ccc0a60ef6289de19616d3048d3a13459 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Wed, 12 Apr 2017 11:20:42 +0100 Subject: [PATCH] Load submit-rageshake asynchronously ... because it's 250K :/ --- .../views/dialogs/BugReportDialog.js | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/components/views/dialogs/BugReportDialog.js b/src/components/views/dialogs/BugReportDialog.js index badc994bb..8db796eeb 100644 --- a/src/components/views/dialogs/BugReportDialog.js +++ b/src/components/views/dialogs/BugReportDialog.js @@ -16,7 +16,6 @@ limitations under the License. import React from 'react'; import sdk from 'matrix-react-sdk'; -import submit_rageshake from '../../../vector/submit-rageshake'; import SdkConfig from 'matrix-react-sdk/lib/SdkConfig'; export default class BugReportDialog extends React.Component { @@ -48,14 +47,17 @@ export default class BugReportDialog extends React.Component { return; } this.setState({ busy: true, err: null }); - submit_rageshake(SdkConfig.get().bug_report_endpoint_url, { - userText: userText, - sendLogs: sendLogs, - }).then(() => { - this.setState({ busy: false }); - this.props.onFinished(false); - }, (err) => { - this.setState({ busy: false, err: `Failed: ${err.message}` }); + + require(['../../../vector/submit-rageshake'], (s) => { + s(SdkConfig.get().bug_report_endpoint_url, { + userText: userText, + sendLogs: sendLogs, + }).then(() => { + this.setState({ busy: false }); + this.props.onFinished(false); + }, (err) => { + this.setState({ busy: false, err: `Failed: ${err.message}` }); + }); }); }