Skip to content

Commit 10671aa

Browse files
authored
Merge pull request element-hq#7755 from vector-im/travis/rageshake-console
Add a function to send a rageshake from the console
2 parents b5c27ca + 373f850 commit 10671aa

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

src/vector/rageshakesetup.js

Lines changed: 16 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,18 @@ function initRageshake() {
4445
}
4546

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

0 commit comments

Comments
 (0)