Skip to content

Commit

Permalink
Merge pull request #7755 from vector-im/travis/rageshake-console
Browse files Browse the repository at this point in the history
Add a function to send a rageshake from the console
  • Loading branch information
turt2live authored Nov 29, 2018
2 parents b5c27ca + 373f850 commit 10671aa
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/vector/rageshakesetup.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand All @@ -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);
});
});
};

0 comments on commit 10671aa

Please sign in to comment.