Compare commits

...

3 Commits

Author SHA1 Message Date
21pages
8deee9b281 fix: don't clear audit_guid during reconnect, clear it after connection established
Signed-off-by: 21pages <sunboeasy@gmail.com>
2026-03-15 23:00:46 +08:00
copilot-swe-agent[bot]
439e3abc79 Fix: show ask-for-note dialog when user clicks OK on reconnecting screen (#14527)
Co-authored-by: rustdesk <71636191+rustdesk@users.noreply.github.com>
2026-03-12 15:18:50 +00:00
copilot-swe-agent[bot]
b8c0787273 Initial plan 2026-03-12 15:12:58 +00:00
2 changed files with 20 additions and 6 deletions

View File

@@ -1016,19 +1016,31 @@ class FfiModel with ChangeNotifier {
showMsgBox(SessionID sessionId, String type, String title, String text, showMsgBox(SessionID sessionId, String type, String title, String text,
String link, bool hasRetry, OverlayDialogManager dialogManager, String link, bool hasRetry, OverlayDialogManager dialogManager,
{bool? hasCancel}) async { {bool? hasCancel}) async {
final showNoteEdit = parent.target != null && final noteAllowed = parent.target != null &&
allowAskForNoteAtEndOfConnection(parent.target, false) && allowAskForNoteAtEndOfConnection(parent.target, false) &&
(title == "Connection Error" || type == "restarting") && (title == "Connection Error" || type == "restarting");
!hasRetry; final showNoteEdit = noteAllowed && !hasRetry;
if (showNoteEdit) { if (showNoteEdit) {
await showConnEndAuditDialogCloseCanceled( await showConnEndAuditDialogCloseCanceled(
ffi: parent.target!, type: type, title: title, text: text); ffi: parent.target!, type: type, title: title, text: text);
closeConnection(); closeConnection();
} else { } else {
VoidCallback? onSubmit;
if (noteAllowed && hasRetry) {
final ffi = parent.target!;
onSubmit = () async {
_timer?.cancel();
_timer = null;
await showConnEndAuditDialogCloseCanceled(
ffi: ffi, type: type, title: title, text: text);
closeConnection();
};
}
msgBox(sessionId, type, title, text, link, dialogManager, msgBox(sessionId, type, title, text, link, dialogManager,
hasCancel: hasCancel, hasCancel: hasCancel,
reconnect: hasRetry ? reconnect : null, reconnect: hasRetry ? reconnect : null,
reconnectTimeout: hasRetry ? _reconnects : null); reconnectTimeout: hasRetry ? _reconnects : null,
onSubmit: onSubmit);
} }
_timer?.cancel(); _timer?.cancel();
if (hasRetry) { if (hasRetry) {

View File

@@ -1289,8 +1289,7 @@ impl<T: InvokeUiSession> Session<T> {
drop(connection_round_state_lock); drop(connection_round_state_lock);
let cloned = self.clone(); let cloned = self.clone();
*cloned.audit_guid.lock().unwrap() = String::new();
*cloned.last_audit_note.lock().unwrap() = String::new();
// override only if true // override only if true
if true == force_relay { if true == force_relay {
self.lc.write().unwrap().force_relay = true; self.lc.write().unwrap().force_relay = true;
@@ -1813,6 +1812,9 @@ impl<T: InvokeUiSession> Interface for Session<T> {
); );
} }
self.update_privacy_mode(); self.update_privacy_mode();
// Clear audit_guid when connection is established successfully
*self.audit_guid.lock().unwrap() = String::new();
*self.last_audit_note.lock().unwrap() = String::new();
// Save recent peers, then push event to flutter. So flutter can refresh peer page. // Save recent peers, then push event to flutter. So flutter can refresh peer page.
self.lc.write().unwrap().handle_peer_info(&pi); self.lc.write().unwrap().handle_peer_info(&pi);
self.set_peer_info(&pi); self.set_peer_info(&pi);