feature fix browser not get privacy flags bug.

This commit is contained in:
alves
2026-01-21 19:19:24 +08:00
parent e4aa63b394
commit df5a423231
2 changed files with 26 additions and 10 deletions

View File

@@ -1421,7 +1421,10 @@ void SSWCP_Instance::sw_Unsubscribe_Filter() {
}
}
}
else
{
BOOST_LOG_TRIVIAL(warning) << "no this cmd for:" << cmd;
}
send_to_js();
finish_job();
}
@@ -3695,6 +3698,7 @@ void SSWCP_MachineOption_Instance::sw_GetTimelapseInstance()
handle_general_fail();
}
}
void SSWCP_MachineOption_Instance::CmdForwarding() {
try {
std::shared_ptr<PrintHost> host = nullptr;
@@ -3886,6 +3890,7 @@ void SSWCP_MachineConnect_Instance::sw_get_pin_code()
self->send_to_js();
self->finish_job();
std::string dc_msg = "success";
bool flag = mqtt_client->Disconnect(dc_msg);
wxGetApp().CallAfter([mqtt_client]() { delete mqtt_client; });
@@ -4267,7 +4272,12 @@ void SSWCP_UserLogin_Instance::process()
sw_GetUserLoginState();
} else if (m_cmd == "sw_SubscribeUserLoginState") {
sw_SubscribeUserLoginState();
} else {
}
else if (m_cmd == UPDATE_PRIVACY_STATUS)
{
sw_SubUserUpdatePrivacy();
}
else {
handle_general_fail();
}
}
@@ -4332,6 +4342,17 @@ void SSWCP_UserLogin_Instance::sw_GetUserLoginState()
}
}
void SSWCP_UserLogin_Instance::sw_SubUserUpdatePrivacy()
{
try {
std::weak_ptr<SSWCP_Instance> weak_ptr = shared_from_this();
wxGetApp().m_user_update_privacy_subscribers[m_webview] = weak_ptr;
} catch (std::exception& e) {
handle_general_fail();
}
}
void SSWCP_UserLogin_Instance::sw_SubscribeUserLoginState()
{
try {
@@ -5823,9 +5844,8 @@ std::unordered_set<std::string> SSWCP::m_project_cmd_list = {
"sw_NewProject", "sw_OpenProject", "sw_GetRecentProjects", "sw_OpenRecentFile", "sw_DeleteRecentFiles", "sw_SubscribeRecentFiles",
};
std::unordered_set<std::string> SSWCP::m_login_cmd_list = {
"sw_UserLogin", "sw_UserLogout", "sw_GetUserLoginState", "sw_SubscribeUserLoginState"
};
std::unordered_set<std::string> SSWCP::m_login_cmd_list = {"sw_UserLogin", "sw_UserLogout", "sw_GetUserLoginState",
"sw_SubscribeUserLoginState", UPDATE_PRIVACY_STATUS};
std::unordered_set<std::string> SSWCP::m_machine_manage_cmd_list = {
"sw_GetLocalDevices", "sw_AddDevice", "sw_SubscribeLocalDevices", "sw_RenameDevice", "sw_SwitchModel", "sw_DeleteDevices"

View File

@@ -310,9 +310,6 @@ private:
void sw_mqtt_publish();
void sw_mqtt_set_engine();
private:
void clean_current_engine();
@@ -426,7 +423,7 @@ private:
void sw_DeleteCameraTimelapse();
void sw_GetTimelapseInstance();
void sw_DefectDetactionConfig();
void sw_DefectDetactionConfig();
void CmdForwarding();
@@ -535,7 +532,6 @@ private:
void sw_SubscribeUserLoginState();
void sw_SubUserUpdatePrivacy();
};
// Instance class for homepage business