diff --git a/src/vector/rageshakesetup.js b/src/vector/rageshakesetup.js index b240e15917..e244940673 100644 --- a/src/vector/rageshakesetup.js +++ b/src/vector/rageshakesetup.js @@ -26,6 +26,7 @@ limitations under the License. */ import rageshake from "matrix-react-sdk/lib/rageshake/rageshake"; +import SdkConfig from "matrix-react-sdk/src/SdkConfig"; function initRageshake() { rageshake.init().then(() => { @@ -44,3 +45,17 @@ function initRageshake() { } initRageshake(); + +global.mxSendRageshake = function(text, withLogs) { + require(['matrix-react-sdk/lib/rageshake/submit-rageshake'], (s) => { + s(SdkConfig.get().bug_report_endpoint_url, { + userText: text, + sendLogs: withLogs, + progressCallback: console.log, + }).then(() => { + console.log("Bug report sent!"); + }, (err) => { + console.error(err); + }); + }); +}; \ No newline at end of file