diff --git a/frontend/src/lib/components/user/FileRow.svelte b/frontend/src/lib/components/user/FileRow.svelte index 36bbc38..d184601 100644 --- a/frontend/src/lib/components/user/FileRow.svelte +++ b/frontend/src/lib/components/user/FileRow.svelte @@ -22,6 +22,7 @@ } from '../../../server/files'; import { getWebhooksForSpecifiedUser, sendWebhook } from '../../../server/webhooks'; import { FileMetadata } from '../../types/FileMetadata'; + import { onMount } from 'svelte'; export let file = new FileMetadata( 'test', @@ -61,8 +62,14 @@ }); const downloadFile = () => { - if (file.encrypted) isDownloadWindowVisible = true; - else getFile(); + if (file.encrypted) { + isDownloadWindowVisible = true; + window.scrollTo(0, 0); + + return; + } + + getFile(); }; const getFile = async () => { @@ -201,6 +208,7 @@ const openShare = () => { if (file.shared) { visible = true; + window.scrollTo(0, 0); } }; @@ -212,6 +220,12 @@ minute: 'numeric' }); + let currentUsername: string | null = null; + + onMount(() => { + currentUsername = localStorage.getItem('username'); + }); + $: ({ classes, getStyles } = useStyles()); @@ -288,10 +302,39 @@ Share File + + + + + {#if currentUsername === usernameShare} + You cannot share files with yourself. + {/if} + + + + + + + + +
+ + Shared With {#if file.shared_people.length > 0} {#each file.shared_people as share} - - + + {share.username} @@ -306,17 +349,6 @@ {:else} This file is not yet shared with anyone. {/if} -
- - - - - - -
- - -
@@ -332,9 +364,10 @@ name="filepassword" bind:value={downloadFilePassword} placeholder="Password..." + required /> - diff --git a/frontend/src/lib/components/user/WebhookRow.svelte b/frontend/src/lib/components/user/WebhookRow.svelte index 35cbc82..7dba60c 100644 --- a/frontend/src/lib/components/user/WebhookRow.svelte +++ b/frontend/src/lib/components/user/WebhookRow.svelte @@ -59,10 +59,10 @@ - {webhook.platform} + {webhook.platform.length > 50 ? `${webhook.platform.slice(0, 50)}...` : webhook.platform} - {webhook.url} + {webhook.url.length > 50 ? `${webhook.url.slice(0, 50)}...` : webhook.url} diff --git a/frontend/src/routes/auth/login/+page.svelte b/frontend/src/routes/auth/login/+page.svelte index 421fca6..102313e 100644 --- a/frontend/src/routes/auth/login/+page.svelte +++ b/frontend/src/routes/auth/login/+page.svelte @@ -1,8 +1,8 @@