From 84194188f83101c3043dc5e8f5f70e7229dbde7f Mon Sep 17 00:00:00 2001 From: dijunkun Date: Thu, 14 Nov 2024 17:26:08 +0800 Subject: [PATCH] [fix] fix redundant recent connection cache file due to remember_password_ flag not being set correctly --- src/single_window/main_window.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/single_window/main_window.cpp b/src/single_window/main_window.cpp index 089532e..6eedc22 100644 --- a/src/single_window/main_window.cpp +++ b/src/single_window/main_window.cpp @@ -210,6 +210,9 @@ int Render::ShowRecentConnections() { LOG_ERROR("Connect to [{}], password [{}]", remote_id.c_str(), password.c_str()); remote_id_ = remote_id; + if (!password.empty() && password.size() == 6) { + remember_password_ = true; + } strncpy(remote_password_, password.c_str(), 6); ConnectTo(); } @@ -220,11 +223,10 @@ int Render::ShowRecentConnections() { ImGui::EndChild(); - // 绘制纵向分割线 if (count != recent_connections_count - 1) { ImVec2 line_start = ImVec2(image_screen_pos.x + recent_connection_image_width_ + 20.0f, - image_screen_pos.y); // 起点 + image_screen_pos.y); ImVec2 line_end = ImVec2( image_screen_pos.x + recent_connection_image_width_ + 20.0f, image_screen_pos.y + recent_connection_image_height_ + button_height);