mirror of
https://github.com/Sani7/remote-ui.git
synced 2026-10-26 21:51:13 +01:00
b simulator + websocket
simulator changed_UI_items returning null instead of {}
cleanup of process broadcast discard on empty update
This commit is contained in:
@@ -85,11 +85,11 @@ json Simulators::changed_UI_items()
|
|||||||
{
|
{
|
||||||
if (this->m_simulators.empty())
|
if (this->m_simulators.empty())
|
||||||
{
|
{
|
||||||
return json();
|
return "{}"_json;
|
||||||
}
|
}
|
||||||
if (this->m_current_simulator.empty())
|
if (this->m_current_simulator.empty())
|
||||||
{
|
{
|
||||||
return json();
|
return "{}"_json;
|
||||||
}
|
}
|
||||||
|
|
||||||
json after = this->m_simulators.at(m_current_simulator)->get_UI_items();
|
json after = this->m_simulators.at(m_current_simulator)->get_UI_items();
|
||||||
|
|||||||
+4
-1
@@ -127,7 +127,10 @@ void Websocket::process_broadcast()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
std::string update = m_on_update();
|
std::string update = m_on_update();
|
||||||
if (!update.empty() && update != "{}")
|
if (update.empty() || update == "{}")
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> guard(m_connection_lock);
|
std::lock_guard<std::mutex> guard(m_connection_lock);
|
||||||
for (auto it = m_connections.begin(); it != m_connections.end(); ++it) {
|
for (auto it = m_connections.begin(); it != m_connections.end(); ++it) {
|
||||||
|
|||||||
Reference in New Issue
Block a user