Files
Oxicloud/frontend/src/routes/+page.svelte
T

21 lines
798 B
Svelte
Raw Normal View History

2026-06-17 17:06:30 -06:00
<script lang="ts">
import { goto } from '$app/navigation';
import { resolve } from '$app/paths';
2026-06-17 17:06:30 -06:00
import { onMount } from 'svelte';
2026-06-20 01:28:52 +02:00
import { session } from '$lib/stores/session.svelte';
2026-06-17 17:06:30 -06:00
2026-06-20 01:28:52 +02:00
// The app root redirects by user kind:
// - external users (magic-link / OIDC-only / OCM recipients) have no
// personal drive, so they land on Shared-with-me;
// - internal users go to the files browser, which resolves the default
// personal drive's root folder via `session.loadHomeFolder()` (post-D0
// this reads `GET /api/drives` and picks the row whose
// `default_for_user` matches the caller).
2026-06-17 17:06:30 -06:00
onMount(() => {
2026-06-20 01:28:52 +02:00
const target = session.isExternalUser ? '/shared-with-me' : '/files';
void goto(resolve(target), { replaceState: true });
2026-06-17 17:06:30 -06:00
});
</script>
<p>Loading…</p>