Skip to content

Commit

Permalink
fix: it can't be navigated in homepage
Browse files Browse the repository at this point in the history
  • Loading branch information
womendoushihaoyin committed Nov 18, 2024
1 parent 3c6f73e commit ed09a90
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/slic3r/GUI/WebSMUserLoginDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ void SMUserLogin::OnNavigationRequest(wxWebViewEvent &evt)
http.on_complete([&](std::string body, unsigned status) {
if (status == 200) {
json response = json::parse(body);
wxGetApp().CallAfter([response]() {
wxGetApp().CallAfter([this, response]() {
if (response.count("data")) {
json data = response["data"];
if (data.count("nickname")) {
Expand All @@ -194,6 +194,9 @@ void SMUserLogin::OnNavigationRequest(wxWebViewEvent &evt)
wxGetApp().sm_get_userinfo()->set_user_icon_url(data["icon"].get<std::string>());
}
}

wxLaunchDefaultBrowser(m_home_url);
this->Hide();
});
}
})
Expand All @@ -203,7 +206,12 @@ void SMUserLogin::OnNavigationRequest(wxWebViewEvent &evt)
.perform();
});
this->RunScript("document.cookie = '';");
load_url(m_home_url);
// load_url(m_home_url);
} else {
if (tmpUrl.find("/logout") != std::string::npos) {
this->Hide();
wxLaunchDefaultBrowser(m_home_url);
}
}
UpdateState();
}
Expand Down

0 comments on commit ed09a90

Please sign in to comment.