diff --git a/src/App.svelte b/src/App.svelte index 2c236c0..96debcf 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -26,7 +26,9 @@ }; -
+
{#if $activeUser} diff --git a/src/components/FileCard.svelte b/src/components/FileCard.svelte index c93bc25..dcbdcd3 100644 --- a/src/components/FileCard.svelte +++ b/src/components/FileCard.svelte @@ -19,6 +19,9 @@ ? new URL(file.hash + (file.mimeType ? "." + mime.getExtension(file.mimeType) : ""), $servers[0]).toString() : undefined; + $: extension = file.mimeType ? mime.getExtension(file.mimeType) : "bin"; + $: preview = file.mimeType?.startsWith("image/") && file.size < 1024 * 100; + function toggleSelect() { if (selected) dispatch("unselect", file.name); else dispatch("select", file.name); @@ -46,8 +49,12 @@ }} bind:checked={selected} /> -
- {file.mimeType ? mime.getExtension(file.mimeType) : "bin"} +
+ {#if preview && link} +
+ {:else} + {extension} + {/if}

{file.name}
@@ -69,3 +76,14 @@ > + + diff --git a/src/components/SpeedDialMenu.svelte b/src/components/SpeedDialMenu.svelte index e5391bf..0aff9ba 100644 --- a/src/components/SpeedDialMenu.svelte +++ b/src/components/SpeedDialMenu.svelte @@ -1,7 +1,7 @@