From 710e295b44c78d72bc96011fe91f72148e0e9868 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Tue, 27 Nov 2018 16:03:37 -0700 Subject: [PATCH] Add a function to send a rageshake from the console This is mostly useful for cases when the UI is broken or the user can't access the button because they aren't logged in. This is particularly helpful for troubleshooting issues with .well-known discovery if/when they come up. Ref: https://github.com/vector-im/riot-web/issues/4802 --- src/vector/rageshakesetup.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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