Safely bind console.log and default withLogs to true

This commit is contained in:
Travis Ralston 2018-11-29 13:13:46 -07:00
parent ac34ca11df
commit 373f850002
1 changed files with 2 additions and 1 deletions

View File

@ -47,11 +47,12 @@ function initRageshake() {
initRageshake(); initRageshake();
global.mxSendRageshake = function(text, withLogs) { global.mxSendRageshake = function(text, withLogs) {
if (withLogs === undefined) withLogs = true;
require(['matrix-react-sdk/lib/rageshake/submit-rageshake'], (s) => { require(['matrix-react-sdk/lib/rageshake/submit-rageshake'], (s) => {
s(SdkConfig.get().bug_report_endpoint_url, { s(SdkConfig.get().bug_report_endpoint_url, {
userText: text, userText: text,
sendLogs: withLogs, sendLogs: withLogs,
progressCallback: console.log, progressCallback: console.log.bind(console),
}).then(() => { }).then(() => {
console.log("Bug report sent!"); console.log("Bug report sent!");
}, (err) => { }, (err) => {