From 448708182490d551721767bffc34ef35375f5082 Mon Sep 17 00:00:00 2001 From: sijanec Date: Wed, 20 May 2020 19:21:31 +0200 Subject: DO_NOT_MERGE; still testing error reporting optout --- assets/js/app.js.bvr | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'assets/js/app.js.bvr') diff --git a/assets/js/app.js.bvr b/assets/js/app.js.bvr index 413c4a6..a75505e 100644 --- a/assets/js/app.js.bvr +++ b/assets/js/app.js.bvr @@ -54,11 +54,21 @@ function gsecErrorHandlerUI(err) { var error_report_function = async function (msg, url, lineNo, columnNo, error) { - var data = {}; - data.error = {"msg": msg, "url": url, "line": lineNo, "column": columnNo, "obj": error}; - data.client = {"ua": navigator.userAgent, "app_version": app_version, "previous_commit": previous_commit}; - data.type = "error"; - $.post("https://beziapp-report.gimb.tk/", data); + localforage.getItem("errorReporting").then((value) => { + let selectedE = value; + if(value == null || value.length < 1) { + selectedE = "on"; + } + if(selectedE == "on") { + var data = {}; + data.error = {"msg": msg, "url": url, "line": lineNo, "column": columnNo, "obj": error}; + data.client = {"ua": navigator.userAgent, "app_version": app_version, "previous_commit": previous_commit}; + data.type = "error"; + $.post("https://beziapp-report.gimb.tk/", data); + } else { + console.log("error not reported as reporting is disabled!"); + } + }).catch(() => {}); return false; } -- cgit v1.2.3