added force show error parameter to standard toast

This commit is contained in:
vabene1111 2023-05-23 14:18:59 +02:00
parent 45effbbcde
commit 30c6389382

View File

@ -50,7 +50,7 @@ export class StandardToasts {
static FAIL_MOVE = "FAIL_MOVE"
static FAIL_MERGE = "FAIL_MERGE"
static makeStandardToast(context, toast, err) {
static makeStandardToast(context, toast, err = undefined, always_show_errors = false) {
let title = ''
let msg = ''
let variant = ''
@ -124,7 +124,7 @@ export class StandardToasts {
}
let DEBUG = localStorage.getItem("DEBUG") === "True" || false
let DEBUG = localStorage.getItem("DEBUG") === "True" || always_show_errors
if (err !== undefined && 'response' in err && 'headers' in err.response) {
if (DEBUG && err.response.headers['content-type'] === 'application/json' && err.response.status < 500) {