ENH:prevent 500 error pop from popping up multiple times

jira:[for 500 err]

Change-Id: I81c74e75ebaeb3fdc18d0fb34a63205e2be06878
(cherry picked from commit 2fcc7f826482644496db25e096f11334b7e539bf)
This commit is contained in:
tao wang 2024-10-10 17:46:53 +08:00 committed by Noisyfox
parent 8bb7ea7cfc
commit 478fdbc041
2 changed files with 10 additions and 7 deletions

View file

@ -1572,13 +1572,17 @@ void GUI_App::init_networking_callbacks()
// });
m_agent->set_server_callback([this](std::string url, int status) {
if (!m_server_error_dialog) {
m_server_error_dialog = new NetworkErrorDialog(mainframe);
}
if (!m_server_error_dialog->IsShown()) {
CallAfter([this]() {
if (m_server_error_dialog) {
m_server_error_dialog->EndModal(wxCLOSE);
m_server_error_dialog->Destroy();
m_server_error_dialog = nullptr;
}
m_server_error_dialog = new NetworkErrorDialog(mainframe);
m_server_error_dialog->ShowModal();
}
});
});