feat: auto report also hides error toast

This commit is contained in:
18alantom
2022-01-28 18:43:27 +05:30
committed by Alan
parent 6440455470
commit 31ca1389ae
2 changed files with 4 additions and 3 deletions
@@ -99,11 +99,11 @@ module.exports = {
},
{
fieldname: 'autoReportErrors',
label: 'Auto Report Errors',
label: 'Hide & Auto Report Errors',
fieldtype: 'Check',
default: 0,
description: t(
'Automatically report all errors. User will still be notified when an error pops up.'
'Prevent errors from showing and automatically report all errors.'
),
},
],
+2 -1
View File
@@ -76,10 +76,11 @@ export function handleError(
// @ts-ignore
frappe.errorLog.push(errorLogObj);
showToast(getToastProps(errorLogObj));
// @ts-ignore
if (frappe.SystemSettings.autoReportErrors) {
reportError(errorLogObj);
} else {
showToast(getToastProps(errorLogObj));
}
}