mirror of
https://codeberg.org/PLG-Development/PLG-MuDiCS
synced 2026-07-05 16:37:09 +00:00
fix(control): couldn't upload same file multiple times
This commit is contained in:
@@ -23,7 +23,6 @@
|
|||||||
update_current_folder_on_selected_displays,
|
update_current_folder_on_selected_displays,
|
||||||
get_displays_where_path_not_exists,
|
get_displays_where_path_not_exists,
|
||||||
create_path_on_all_selected_displays
|
create_path_on_all_selected_displays
|
||||||
|
|
||||||
} from '$lib/ts/stores/files';
|
} from '$lib/ts/stores/files';
|
||||||
import { slide } from 'svelte/transition';
|
import { slide } from 'svelte/transition';
|
||||||
import InodeElement from '../lib/components/InodeElement.svelte';
|
import InodeElement from '../lib/components/InodeElement.svelte';
|
||||||
@@ -69,7 +68,7 @@
|
|||||||
let popup_content: PopupContent = $state({
|
let popup_content: PopupContent = $state({
|
||||||
open: false,
|
open: false,
|
||||||
snippet: null,
|
snippet: null,
|
||||||
title: '',
|
title: ''
|
||||||
});
|
});
|
||||||
|
|
||||||
let file_input: HTMLInputElement;
|
let file_input: HTMLInputElement;
|
||||||
@@ -119,7 +118,7 @@
|
|||||||
snippet: edit_file_name_popup,
|
snippet: edit_file_name_popup,
|
||||||
title: `${file_is_folder ? 'Ordner' : 'Datei'} umbenennen`,
|
title: `${file_is_folder ? 'Ordner' : 'Datei'} umbenennen`,
|
||||||
title_icon: FolderPlus,
|
title_icon: FolderPlus,
|
||||||
snippet_arg: extension,
|
snippet_arg: extension
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -133,7 +132,7 @@
|
|||||||
open: true,
|
open: true,
|
||||||
snippet: new_folder_popup,
|
snippet: new_folder_popup,
|
||||||
title: 'Neuen Ordner erstellen',
|
title: 'Neuen Ordner erstellen',
|
||||||
title_icon: FolderPlus,
|
title_icon: FolderPlus
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -142,7 +141,7 @@
|
|||||||
open: true,
|
open: true,
|
||||||
snippet: delete_request_popup,
|
snippet: delete_request_popup,
|
||||||
title: `${$selected_file_ids.length} ${$selected_file_ids.length === 1 ? 'Objekt' : 'Objekte'} wirklich löschen?`,
|
title: `${$selected_file_ids.length} ${$selected_file_ids.length === 1 ? 'Objekt' : 'Objekte'} wirklich löschen?`,
|
||||||
title_icon: Trash2,
|
title_icon: Trash2
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -152,7 +151,9 @@
|
|||||||
current_folder_elements: Inode[]
|
current_folder_elements: Inode[]
|
||||||
) {
|
) {
|
||||||
if (current_selected_file_ids.length === 0 && current_folder_elements.length > 0) {
|
if (current_selected_file_ids.length === 0 && current_folder_elements.length > 0) {
|
||||||
current_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 (current_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
|
||||||
@@ -276,8 +277,11 @@
|
|||||||
bind:this={file_input}
|
bind:this={file_input}
|
||||||
multiple
|
multiple
|
||||||
accept={get_accepted_file_type_string()}
|
accept={get_accepted_file_type_string()}
|
||||||
onchange={(e) =>
|
onchange={async (e) => {
|
||||||
add_upload((e.target as HTMLInputElement).files!, $selected_online_display_ids, $current_file_path)}
|
const target = e.target as HTMLInputElement;
|
||||||
|
await add_upload(target.files!, $selected_online_display_ids, $current_file_path);
|
||||||
|
target.value = '';
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div class="bg-stone-800 h-full rounded-2xl grid grid-rows-[2.5rem_1fr] min-h-0">
|
<div class="bg-stone-800 h-full rounded-2xl grid grid-rows-[2.5rem_1fr] min-h-0">
|
||||||
|
|||||||
Reference in New Issue
Block a user