remove useless empty --switch_uuid

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages 2023-02-01 19:49:41 +08:00
parent 76adc8de20
commit 8d60bcd51a
2 changed files with 12 additions and 5 deletions

View File

@ -43,11 +43,14 @@ class RustDeskMultiWindowManager {
Future<dynamic> newRemoteDesktop(String remoteId,
{String? switch_uuid}) async {
final msg = jsonEncode({
var params = {
"type": WindowType.RemoteDesktop.index,
"id": remoteId,
"switch_uuid": switch_uuid ?? ""
});
};
if (switch_uuid != null) {
params['switch_uuid'] = switch_uuid;
}
final msg = jsonEncode(params);
try {
final ids = await DesktopMultiWindow.getAllSubWindowIds();

View File

@ -304,9 +304,13 @@ fn core_main_invoke_new_connection(mut args: std::env::Args) -> Option<Vec<Strin
switch_uuid = args.next();
}
}
let mut param_array = vec![];
if switch_uuid.is_some() {
let switch_uuid = switch_uuid.map_or("".to_string(), |p| format!("switch_uuid={}", p));
param_array.push(switch_uuid);
}
let switch_uuid = switch_uuid.map_or("".to_string(), |p| format!("switch_uuid={}", p));
let params = vec![switch_uuid].join("&");
let params = param_array.join("&");
let params_flag = if params.is_empty() { "" } else { "?" };
#[allow(unused)]
let uni_links = format!(