fix(ui): Error with sending file above connections
This commit is contained in:
1 parent
d38e7f7359
commit
e318699a36
1 file changed
+14
-3
@@ -184,6 +184,8 @@ impl RcloneUI {
|
|||||||
self.current_path = path.to_string();
|
self.current_path = path.to_string();
|
||||||
self.search_results.clear();
|
self.search_results.clear();
|
||||||
self.search_pattern.clear();
|
self.search_pattern.clear();
|
||||||
|
// Очищаем выбранные файлы при смене директории
|
||||||
|
self.selected_paths.clear();
|
||||||
}
|
}
|
||||||
Err(e) => self.error_message = Some(e),
|
Err(e) => self.error_message = Some(e),
|
||||||
}
|
}
|
||||||
@@ -511,11 +513,20 @@ impl eframe::App for RcloneUI {
|
|||||||
}
|
}
|
||||||
ui.heading("Файлы и папки");
|
ui.heading("Файлы и папки");
|
||||||
for file in ¤t_files {
|
for file in ¤t_files {
|
||||||
let selected = self.selected_paths.contains(&file.path);
|
// Формируем полный путь rclone (с именем удалённого хранилища)
|
||||||
|
let full_path = if current_path.ends_with(':') {
|
||||||
|
format!("{}{}", current_path, file.name)
|
||||||
|
} else {
|
||||||
|
format!("{}/{}", current_path, file.name)
|
||||||
|
};
|
||||||
|
let selected = self.selected_paths.contains(&full_path);
|
||||||
ui.horizontal(|ui| {
|
ui.horizontal(|ui| {
|
||||||
if ui.selectable_label(selected, file.icon()).clicked() {
|
if ui.selectable_label(selected, file.icon()).clicked() {
|
||||||
if selected { self.selected_paths.retain(|p| p != &file.path); }
|
if selected {
|
||||||
else { self.selected_paths.push(file.path.clone()); }
|
self.selected_paths.retain(|p| p != &full_path);
|
||||||
|
} else {
|
||||||
|
self.selected_paths.push(full_path.clone());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if file.is_dir {
|
if file.is_dir {
|
||||||
if ui.link(&file.name).clicked() {
|
if ui.link(&file.name).clicked() {
|
||||||
|
|||||||
Reference in new issue
Block a user