Skip to content

Commit 710e295

Browse files
committed
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: element-hq#4802
1 parent b5c27ca commit 710e295

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

‎src/vector/rageshakesetup.js‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ limitations under the License.
2626
*/
2727

2828
import rageshake from "matrix-react-sdk/lib/rageshake/rageshake";
29+
import SdkConfig from "matrix-react-sdk/src/SdkConfig";
2930

3031
function initRageshake() {
3132
rageshake.init().then(() => {
@@ -44,3 +45,17 @@ function initRageshake() {
4445
}
4546

4647
initRageshake();
48+
49+
global.mxSendRageshake = function(text, withLogs) {
50+
require(['matrix-react-sdk/lib/rageshake/submit-rageshake'], (s) => {
51+
s(SdkConfig.get().bug_report_endpoint_url, {
52+
userText: text,
53+
sendLogs: withLogs,
54+
progressCallback: console.log,
55+
}).then(() => {
56+
console.log("Bug report sent!");
57+
}, (err) => {
58+
console.error(err);
59+
});
60+
});
61+
};

0 commit comments

Comments
 (0)