Add error handling of invalid CQP queries

This commit is contained in:
Stephan Porada
2020-01-16 11:56:16 +01:00
parent ef1eb9976e
commit e04b31d282
3 changed files with 24 additions and 7 deletions

View File

@ -258,7 +258,17 @@
});
}
return;
}
} else if (message === "CQI_CQP_ERROR_GENERAL") {
queryResultsTableElement.classList.add("hide");
let toast = M.toast({"classes": "red", "html": `<span>Invalid query entered!</span><button class="btn-flat toast-action white-text" data-action="close"><i class="material-icons">close</i></button>`});
let toastActionElement = toast.el.querySelector(".toast-action[data-action='close']");
if (toastActionElement) {
toastActionElement.addEventListener("click", function() {
toast.dismiss();
});
}
return;
}
var matchElement;
var matchTextTitlesElement;