feat(drive): add drive picker in sidebar
- select by default the home drive
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user