Fixed modal close error because already closed by client side

This commit is contained in:
emeric
2024-04-19 23:42:19 +02:00
parent abd013ad29
commit 53a356dace
+1 -1
View File
@@ -69,7 +69,7 @@ namespace lms::ui
<< R"({const modalElementParent = document.getElementById(')" << modalWidget->id() << R"(');)" << R"({const modalElementParent = document.getElementById(')" << modalWidget->id() << R"(');)"
<< R"(const modalElement = modalElementParent.getElementsByClassName('modal')[0];)" << R"(const modalElement = modalElementParent.getElementsByClassName('modal')[0];)"
<< R"(const modal = bootstrap.Modal.getInstance(modalElement);)" << R"(const modal = bootstrap.Modal.getInstance(modalElement);)"
<< R"(modal.hide();)" << R"(if (modal) { modal.hide(); })" // may already be removed client side
<< R"(})"; << R"(})";
LMS_LOG(UI, DEBUG, "Running JS '" << oss.str() << "'"); LMS_LOG(UI, DEBUG, "Running JS '" << oss.str() << "'");