feat(web): automatically update user info (#5647)
* use svelte store * fix: websocket error when not authenticated * more routes
This commit is contained in:
@@ -20,12 +20,10 @@
|
||||
import { createAssetInteractionStore } from '$lib/stores/asset-interaction.store';
|
||||
import { AssetStore } from '$lib/stores/assets.store';
|
||||
import { openFileUploadDialog } from '$lib/utils/file-uploader';
|
||||
import type { PageData } from './$types';
|
||||
import { assetViewingStore } from '$lib/stores/asset-viewing.store';
|
||||
import { mdiDotsVertical, mdiPlus } from '@mdi/js';
|
||||
import UpdatePanel from '$lib/components/shared-components/update-panel.svelte';
|
||||
|
||||
export let data: PageData;
|
||||
import { user } from '$lib/stores/user.store';
|
||||
|
||||
let { isViewing: showAssetViewer } = assetViewingStore;
|
||||
let handleEscapeKey = false;
|
||||
@@ -52,7 +50,7 @@
|
||||
|
||||
{#if $isMultiSelectState}
|
||||
<AssetSelectControlBar
|
||||
ownerId={data.user.id}
|
||||
ownerId={$user.id}
|
||||
assets={$selectedAssets}
|
||||
clearSelect={() => assetInteractionStore.clearMultiselect()}
|
||||
>
|
||||
@@ -80,7 +78,7 @@
|
||||
</AssetSelectControlBar>
|
||||
{/if}
|
||||
|
||||
<UserPageLayout user={data.user} hideNavbar={$isMultiSelectState} showUploadButton scrollbar={false}>
|
||||
<UserPageLayout hideNavbar={$isMultiSelectState} showUploadButton scrollbar={false}>
|
||||
<AssetGrid
|
||||
{assetStore}
|
||||
{assetInteractionStore}
|
||||
@@ -88,7 +86,7 @@
|
||||
on:escape={handleEscape}
|
||||
withStacked
|
||||
>
|
||||
{#if data.user.memoriesEnabled}
|
||||
{#if $user.memoriesEnabled}
|
||||
<MemoryLane />
|
||||
{/if}
|
||||
<EmptyPlaceholder
|
||||
|
||||
@@ -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: 'Photos',
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user