fix: SimplyPrint device tab ignores the uploaded file import URL (#16555)

The tab switch queued a reload of the host's home page, which ran after the import URL and replaced it. Switch tabs synchronously first, then queue the import URL so it is the last page loaded.
This commit is contained in:
Javad Shafique authored and GitHub committed 2026-10-20 13:28:36 -05:00
1 parent 37dcc65752
commit c081aa97f7
1 file changed
+7 -3
+7 -3
View File
@@ -350,9 +350,13 @@ bool SimplyPrint::do_temp_upload(const boost::filesystem::path& file_path,
if (should_open_in_external_browser()) {
wxLaunchDefaultBrowser(url);
} else {
const auto mainframe = GUI::wxGetApp().mainframe;
mainframe->request_select_tab(TAB_ID_MONITOR);
mainframe->load_printer_url(url);
// The tab switch queues a reload of the printer's home page, so switch synchronously
// first and queue the import page after it.
GUI::wxGetApp().CallAfter([url = wxString::FromUTF8(url)] {
const auto mainframe = GUI::wxGetApp().mainframe;
mainframe->select_tab(TAB_ID_MONITOR);
mainframe->load_printer_url(url);
});
}
return true;