2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 07:40:55 +00:00

feat: auto report also hides error toast

This commit is contained in:
18alantom 2022-01-28 18:37:51 +05:30 committed by Alan
parent 6440455470
commit 31ca1389ae
2 changed files with 4 additions and 3 deletions

View File

@ -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.'
),
},
],

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));
}
}