mirror of
https://codeberg.org/PLG-Development/PLG-MuDiCS
synced 2026-07-05 16:37:09 +00:00
fix(control): deselect file for sync
This commit is contained in:
@@ -14,7 +14,7 @@
|
|||||||
import { change_height, current_height, next_height_step_size } from '$lib/ts/stores/ui_behavior';
|
import { change_height, current_height, next_height_step_size } from '$lib/ts/stores/ui_behavior';
|
||||||
import Button from '$lib/components/Button.svelte';
|
import Button from '$lib/components/Button.svelte';
|
||||||
import PathBar from './PathBar.svelte';
|
import PathBar from './PathBar.svelte';
|
||||||
import { selected_display_ids, selected_file_ids } from '$lib/ts/stores/select';
|
import { select, selected_display_ids, selected_file_ids } from '$lib/ts/stores/select';
|
||||||
import {
|
import {
|
||||||
current_file_path,
|
current_file_path,
|
||||||
get_folder_elements,
|
get_folder_elements,
|
||||||
@@ -149,16 +149,17 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
async function sync_selected_files(
|
async function sync_selected_files(
|
||||||
selected_file_ids: string[],
|
current_selected_file_ids: string[],
|
||||||
selected_display_ids: string[],
|
selected_display_ids: string[],
|
||||||
current_folder_elements: Inode[]
|
current_folder_elements: Inode[]
|
||||||
) {
|
) {
|
||||||
if (selected_file_ids.length === 0 && current_folder_elements.length > 0) {
|
if (current_selected_file_ids.length === 0 && current_folder_elements.length > 0) {
|
||||||
selected_file_ids = current_folder_elements.map((inode) => get_file_primary_key(inode));
|
current_selected_file_ids = current_folder_elements.map((inode) => get_file_primary_key(inode));
|
||||||
}
|
}
|
||||||
if (selected_file_ids.length === 0) return;
|
if (current_selected_file_ids.length === 0) return;
|
||||||
// Mit For-Schleife über ausgewählte Elemente gehen
|
// Mit For-Schleife über ausgewählte Elemente gehen
|
||||||
for (const file_id of selected_file_ids) {
|
for (const file_id of current_selected_file_ids) {
|
||||||
|
await select(selected_file_ids, file_id, 'deselect');
|
||||||
await add_sync_recursively(file_id, selected_display_ids);
|
await add_sync_recursively(file_id, selected_display_ids);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user