From a1b9a1d244a1a05863e7743b443ca8b5fc10fb4b Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 16 Jun 2023 10:09:16 -0500 Subject: [PATCH] fix(web): error when refreshing asset view in memory page (#2789) --- .../routes/(user)/memory/photos/+page.server.ts | 14 ++++++++++++++ web/src/routes/(user)/memory/photos/+page.svelte | 0 .../(user)/memory/photos/[assetId]/+page.server.ts | 14 ++++++++++++++ .../(user)/memory/photos/[assetId]/+page.svelte | 0 4 files changed, 28 insertions(+) create mode 100644 web/src/routes/(user)/memory/photos/+page.server.ts create mode 100644 web/src/routes/(user)/memory/photos/+page.svelte create mode 100644 web/src/routes/(user)/memory/photos/[assetId]/+page.server.ts create mode 100644 web/src/routes/(user)/memory/photos/[assetId]/+page.svelte diff --git a/web/src/routes/(user)/memory/photos/+page.server.ts b/web/src/routes/(user)/memory/photos/+page.server.ts new file mode 100644 index 0000000000..a549893172 --- /dev/null +++ b/web/src/routes/(user)/memory/photos/+page.server.ts @@ -0,0 +1,14 @@ +import { redirect } from '@sveltejs/kit'; +export const prerender = false; + +import type { PageServerLoad } from './$types'; + +export const load: PageServerLoad = async ({ parent }) => { + const { user } = await parent(); + + if (!user) { + throw redirect(302, '/auth/login'); + } else { + throw redirect(302, '/memory'); + } +}; diff --git a/web/src/routes/(user)/memory/photos/+page.svelte b/web/src/routes/(user)/memory/photos/+page.svelte new file mode 100644 index 0000000000..e69de29bb2 diff --git a/web/src/routes/(user)/memory/photos/[assetId]/+page.server.ts b/web/src/routes/(user)/memory/photos/[assetId]/+page.server.ts new file mode 100644 index 0000000000..a549893172 --- /dev/null +++ b/web/src/routes/(user)/memory/photos/[assetId]/+page.server.ts @@ -0,0 +1,14 @@ +import { redirect } from '@sveltejs/kit'; +export const prerender = false; + +import type { PageServerLoad } from './$types'; + +export const load: PageServerLoad = async ({ parent }) => { + const { user } = await parent(); + + if (!user) { + throw redirect(302, '/auth/login'); + } else { + throw redirect(302, '/memory'); + } +}; diff --git a/web/src/routes/(user)/memory/photos/[assetId]/+page.svelte b/web/src/routes/(user)/memory/photos/[assetId]/+page.svelte new file mode 100644 index 0000000000..e69de29bb2