Browse Source

Merge pull request #7755 from vector-im/travis/rageshake-console

Add a function to send a rageshake from the console
pull/7771/head
Travis Ralston 3 years ago
committed by GitHub
parent
commit
10671aa06e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      src/vector/rageshakesetup.js

16
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,18 @@ function initRageshake() {
}
initRageshake();
global.mxSendRageshake = function(text, withLogs) {
if (withLogs === undefined) withLogs = true;
require(['matrix-react-sdk/lib/rageshake/submit-rageshake'], (s) => {
s(SdkConfig.get().bug_report_endpoint_url, {
userText: text,
sendLogs: withLogs,
progressCallback: console.log.bind(console),
}).then(() => {
console.log("Bug report sent!");
}, (err) => {
console.error(err);
});
});
};

Loading…
Cancel
Save