From 40813a6b339566248f4fa144e15de18e083eeff6 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 15 Sep 2020 15:49:25 +0100 Subject: [PATCH] If no bug_report_endpoint_url, hide rageshaking from the App --- src/vector/rageshakesetup.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/vector/rageshakesetup.ts b/src/vector/rageshakesetup.ts index e495557429..cc29670213 100644 --- a/src/vector/rageshakesetup.ts +++ b/src/vector/rageshakesetup.ts @@ -51,12 +51,18 @@ export function initRageshake() { } window.mxSendRageshake = function(text: string, withLogs?: boolean) { + const url = SdkConfig.get().bug_report_endpoint_url; + if (!url) { + console.error("Cannot send a rageshake - no bug_report_endpoint_url configured"); + return; + } + if (withLogs === undefined) withLogs = true; if (!text || !text.trim()) { console.error("Cannot send a rageshake without a message - please tell us what went wrong"); return; } - sendBugReport(SdkConfig.get().bug_report_endpoint_url, { + sendBugReport(url, { userText: text, sendLogs: withLogs, progressCallback: console.log.bind(console),