feat(drive): add drive picker in sidebar

- select by default the home drive
This commit is contained in:
Edouard Vanbelle
2026-06-20 01:28:52 +02:00
parent cf72f8a77b
commit cf7ad87c54
11 changed files with 344 additions and 40 deletions
+10 -2
View File
@@ -1,10 +1,18 @@
<script lang="ts">
import { goto } from '$app/navigation';
import { onMount } from 'svelte';
import { session } from '$lib/stores/session.svelte';
// The app root redirects to the primary files view.
// 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(() => {
void goto('/files', { replaceState: true });
const target = session.isExternalUser ? '/shared-with-me' : '/files';
void goto(target, { replaceState: true });
});
</script>