mirror of
https://github.com/kunkundi/crossdesk.git
synced 2026-03-22 07:37:29 +08:00
[fix] fix incorrect online status of recently connections
This commit is contained in:
@@ -227,14 +227,8 @@ int Render::ShowRecentConnections() {
|
||||
if (ImGui::Button(connect_to_this_connection_button_name.c_str(),
|
||||
ImVec2(recent_connection_button_width,
|
||||
recent_connection_button_height))) {
|
||||
if (online) {
|
||||
ConnectTo(it.second.remote_id, it.second.password.c_str(),
|
||||
it.second.remember_password);
|
||||
} else {
|
||||
show_offline_warning_window_ = true;
|
||||
offline_warning_text_ =
|
||||
localization::device_offline[localization_language_index_];
|
||||
}
|
||||
}
|
||||
}
|
||||
ImGui::SetWindowFontScale(1.0f);
|
||||
|
||||
@@ -498,9 +498,9 @@ void Render::OnReceiveDataBufferCb(const char* data, size_t size,
|
||||
const double bps =
|
||||
(static_cast<double>(delta_bytes) * 8.0) / delta_seconds;
|
||||
if (bps > 0.0) {
|
||||
const double capped =
|
||||
(std::min)(bps, static_cast<double>(
|
||||
(std::numeric_limits<uint32_t>::max)()));
|
||||
const double capped = (std::min)(
|
||||
bps,
|
||||
static_cast<double>((std::numeric_limits<uint32_t>::max)()));
|
||||
estimated_rate_bps = static_cast<uint32_t>(capped);
|
||||
}
|
||||
}
|
||||
@@ -655,6 +655,7 @@ void Render::OnSignalStatusCb(SignalStatus status, const char* user_id,
|
||||
render->signal_connected_ = false;
|
||||
} else if (SignalStatus::SignalConnected == status) {
|
||||
render->signal_connected_ = true;
|
||||
render->need_to_send_recent_connections_ = true;
|
||||
LOG_INFO("[{}] connected to signal server", client_id);
|
||||
} else if (SignalStatus::SignalFailed == status) {
|
||||
render->signal_connected_ = false;
|
||||
|
||||
Reference in New Issue
Block a user