enable errors to persist even if a general error is incoming

This commit is contained in:
David Remer 2020-08-24 12:04:31 +03:00
parent 103faec26d
commit deffc2d0e8

View file

@ -7,13 +7,21 @@ class ErrorHandler {
}
genericError() {
if (this.wrapper.classList.contains('ppcp-persist')) {
return;
}
this.clear();
this.message(this.genericErrorText)
}
message(text)
message(text, persist = false)
{
this.wrapper.classList.add('woocommerce-error');
if (persist) {
this.wrapper.classList.add('ppcp-persist');
} else {
this.wrapper.classList.remove('ppcp-persist');
}
this.wrapper.innerText = this.sanitize(text);
jQuery.scroll_to_notices(jQuery('.woocommerce-notices-wrapper'))
}