feat(web): automatically update user info (#5647)

* use svelte store

* fix: websocket error when not authenticated

* more routes
This commit is contained in:
martin
2023-12-12 17:35:28 +01:00
committed by GitHub
parent cbca69841a
commit c602eaea4a
54 changed files with 114 additions and 155 deletions
+2 -2
View File
@@ -39,7 +39,7 @@
};
</script>
<UserPageLayout user={data.user} title={data.meta.title}>
<UserPageLayout title={data.meta.title}>
<div class="flex" slot="buttons">
<LinkButton on:click={createSharedAlbum}>
<div class="flex flex-wrap place-items-center justify-center gap-x-1 text-sm">
@@ -96,7 +96,7 @@
<div class="grid grid-cols-[repeat(auto-fill,minmax(14rem,1fr))]">
{#each data.sharedAlbums as album (album.id)}
<a data-sveltekit-preload-data="hover" href={`albums/${album.id}`} animate:flip={{ duration: 200 }}>
<AlbumCard {album} user={data.user} isSharingView showContextMenu={false} />
<AlbumCard {album} isSharingView showContextMenu={false} />
</a>
{/each}
</div>
+1 -2
View File
@@ -3,12 +3,11 @@ import { api } from '@api';
import type { PageLoad } from './$types';
export const load = (async () => {
const user = await authenticate();
await authenticate();
const { data: sharedAlbums } = await api.albumApi.getAllAlbums({ shared: true });
const { data: partners } = await api.partnerApi.getPartners({ direction: 'shared-with' });
return {
user,
sharedAlbums,
partners,
meta: {
@@ -2,9 +2,8 @@ import { authenticate } from '$lib/utils/auth';
import type { PageLoad } from './$types';
export const load = (async () => {
const user = await authenticate();
await authenticate();
return {
user,
meta: {
title: 'Shared Links',
},