diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index a2670f4fd0..b8e65dc8f4 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -4883,31 +4883,19 @@ void GUI_App::on_http_error(wxCommandEvent &evt) return; } - static bool m_is_error_shown = false; - // Show general error notification for Orca Cloud API failures (not Bambu) if (provider == ORCA_CLOUD_PROVIDER && status >= 400 && code != HttpErrorVersionLimited) { - wxString msg; - if (!error.empty()) { - msg = wxString::Format(_L("Failed to connect to OrcaCloud.\nPlease check your network connectivity\n(HTTP %u): %s"), status, wxString::FromUTF8(error)); - } else { - msg = wxString::Format(_L("Failed to connect to OrcaCloud.\nPlease check your network connectivity\n(HTTP %u)"), status); - } - - if (app_config->get_bool("developer_mode")) { - // Use notification manager if ImGui is ready; fall back to wxMessageBox on Linux - // where ImGui may not be initialized until the user switches to the Prepare tab. - if (wxGetApp().plater() != nullptr && wxGetApp().imgui()->display_initialized()) { - wxGetApp() - .plater() - ->get_notification_manager() - ->push_notification(NotificationType::PlaterError, NotificationManager::NotificationLevel::WarningNotificationLevel, - msg.ToUTF8().data()); + if (wxGetApp().plater() != nullptr && wxGetApp().imgui()->display_initialized()) { + wxString msg; + if (!error.empty()) { + msg = wxString::Format(_L("Failed to connect to OrcaCloud.\nPlease check your network connectivity\n(HTTP %u): %s"), status, wxString::FromUTF8(error)); + } else { + msg = wxString::Format(_L("Failed to connect to OrcaCloud.\nPlease check your network connectivity\n(HTTP %u)"), status); } - } - - if (!m_is_error_shown) { - m_is_error_shown = true; - wxMessageBox(msg, _L("Cloud Error"), wxOK | wxICON_ERROR, wxGetApp().mainframe); + wxGetApp() + .plater() + ->get_notification_manager() + ->push_notification(NotificationType::PlaterError, NotificationManager::NotificationLevel::WarningNotificationLevel, + msg.ToUTF8().data()); } } } diff --git a/src/slic3r/Utils/OrcaCloudServiceAgent.cpp b/src/slic3r/Utils/OrcaCloudServiceAgent.cpp index 5417fad995..db1c60b842 100644 --- a/src/slic3r/Utils/OrcaCloudServiceAgent.cpp +++ b/src/slic3r/Utils/OrcaCloudServiceAgent.cpp @@ -500,14 +500,10 @@ int OrcaCloudServiceAgent::start() { regenerate_pkce(); - // Attempt silent sign-in from stored refresh token. - // Use async=true so the HTTP round-trip does not block the main UI thread. - // start_sync_user_preset() guards with is_user_login(), so if the refresh has - // not completed by the time it is called the sync simply defers to the next - // login-complete callback — safe and preferred over a 30-second UI stall. + // Attempt silent sign-in from stored refresh token std::string stored_refresh; if (load_refresh_token(stored_refresh) && !stored_refresh.empty()) { - refresh_now(stored_refresh, "startup_refresh", true); + refresh_now(stored_refresh, "refresh token", false); } return BAMBU_NETWORK_SUCCESS;