diff --git a/control/frontend/src/components/FolderElementObject.svelte b/control/frontend/src/components/FolderElementObject.svelte index 75d9442..d79053c 100644 --- a/control/frontend/src/components/FolderElementObject.svelte +++ b/control/frontend/src/components/FolderElementObject.svelte @@ -14,8 +14,12 @@ get_shifted_color } from '../ts/stores/ui_behavior'; import Button from './Button.svelte'; - import { supported_file_type_icon, type FolderElement, type SupportedFileType } from '../ts/types'; - + import { + supported_file_type_icon, + type FolderElement, + type SupportedFileType + } from '../ts/types'; + import { is_selected, select, @@ -56,7 +60,11 @@ const is_folder = file.type === 'inode/directory'; - function get_created_string(date_object: Date, full_string = false) { + function get_created_string(date_object: Date | null, full_string = false) { + if (!date_object) { + return full_string ? 'Verschiedene Daten auf verschiedenen Bildschirmen' : 'versch.'; + } + if (full_string) { return ( get_formated_date_string(date_object, true) + ' ' + get_formated_time_string(date_object) @@ -167,16 +175,14 @@ })} rounded-r-lg transition-colors duration-200 gap-4 flex flex-row justify-between cursor-pointer group w-full min-w-0" >
-
+
{#if is_folder} {:else if thumbnail_url} file_thumbnail {:else if supported_file_type_icon[get_file_type(file)?.display_name || '']} @@ -187,7 +193,9 @@ {/if}
- {file.name.includes('.') && !is_folder && get_file_type(file) ? file.name.slice(0, file.name.lastIndexOf('.')) : file.name} + {file.name.includes('.') && !is_folder && get_file_type(file) + ? file.name.slice(0, file.name.lastIndexOf('.')) + : file.name}