Files
Oxicloud/frontend/src/routes/+page.svelte
T
Edouard Vanbelle cf7ad87c54 feat(drive): add drive picker in sidebar
- select by default the home drive
2026-06-20 01:37:57 +02:00

20 lines
750 B
Svelte

<script lang="ts">
import { goto } from '$app/navigation';
import { onMount } from 'svelte';
import { session } from '$lib/stores/session.svelte';
// 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).
onMount(() => {
const target = session.isExternalUser ? '/shared-with-me' : '/files';
void goto(target, { replaceState: true });
});
</script>
<p>Loading…</p>