Load submit-rageshake asynchronously

... because it's 250K :/
This commit is contained in:
Richard van der Hoff 2017-04-12 11:20:42 +01:00
parent a34b5abc82
commit 269f9a5ccc

View file

@ -16,7 +16,6 @@ limitations under the License.
import React from 'react'; import React from 'react';
import sdk from 'matrix-react-sdk'; import sdk from 'matrix-react-sdk';
import submit_rageshake from '../../../vector/submit-rageshake';
import SdkConfig from 'matrix-react-sdk/lib/SdkConfig'; import SdkConfig from 'matrix-react-sdk/lib/SdkConfig';
export default class BugReportDialog extends React.Component { export default class BugReportDialog extends React.Component {
@ -48,14 +47,17 @@ export default class BugReportDialog extends React.Component {
return; return;
} }
this.setState({ busy: true, err: null }); this.setState({ busy: true, err: null });
submit_rageshake(SdkConfig.get().bug_report_endpoint_url, {
userText: userText, require(['../../../vector/submit-rageshake'], (s) => {
sendLogs: sendLogs, s(SdkConfig.get().bug_report_endpoint_url, {
}).then(() => { userText: userText,
this.setState({ busy: false }); sendLogs: sendLogs,
this.props.onFinished(false); }).then(() => {
}, (err) => { this.setState({ busy: false });
this.setState({ busy: false, err: `Failed: ${err.message}` }); this.props.onFinished(false);
}, (err) => {
this.setState({ busy: false, err: `Failed: ${err.message}` });
});
}); });
} }