[studio] Fix QuestionPopup to only emit a response when there is a response
All checks were successful
Build / build (push) Successful in 3m36s

This commit is contained in:
Gary Talent 2025-02-03 00:35:37 -06:00
parent 4e068d628c
commit 0abadc1850

View File

@ -260,14 +260,15 @@ void QuestionPopup::draw(StudioContext &ctx, ImVec2 const &sz) noexcept {
if (ImGui::BeginPopupModal(m_title.c_str(), &m_open, modalFlags)) {
ImGui::Text("%s", m_question.c_str());
auto const r = PopupControlsOkCancel(m_open, "Yes", "No");
response.emit(r);
switch (r) {
case PopupResponse::None:
break;
case PopupResponse::OK:
response.emit(r);
close();
break;
case PopupResponse::Cancel:
response.emit(r);
close();
break;
}