diff --git a/src/routes/profile/(local_user)/+layout.svelte b/src/routes/profile/(local_user)/+layout.svelte index e1fb2c81..760952e7 100644 --- a/src/routes/profile/(local_user)/+layout.svelte +++ b/src/routes/profile/(local_user)/+layout.svelte @@ -2,14 +2,6 @@ import { profile } from '$lib/app/auth.svelte' import { t } from '$lib/app/i18n' import { Tabs } from '$lib/ui/layout' - import { Button, Menu, MenuButton } from 'mono-svelte' - import { - ArrowDown, - ArrowUp, - EllipsisHorizontal, - Icon, - Photo, - } from 'svelte-hero-icons/dist' let { children } = $props() @@ -25,46 +17,21 @@
+ - - {#snippet target(attachment)} - - {/snippet} - - {$t('routes.profile.media.title')} - - - {$t('routes.profile.upvoted')} - - - {$t('routes.profile.downvoted')} - - - + />
{@render children?.()} diff --git a/src/routes/profile/(local_user)/settings/+page.ts b/src/routes/profile/(local_user)/settings/+page.ts new file mode 100644 index 00000000..c0feaa3e --- /dev/null +++ b/src/routes/profile/(local_user)/settings/+page.ts @@ -0,0 +1,11 @@ +import { error } from '@sveltejs/kit' + +// TODO(coves-migration): The profile settings page is unmigrated Lemmy code — +// its entire form is gated on the legacy `my_user.local_user_view` shape +// (always undefined now), so it rendered as a blank page, and saving still +// called the legacy saveUserSettings endpoint. The Coves API does have +// social.coves.actor.updateProfile; remove this gate once the page is +// migrated to it. +export function load(): never { + error(404, 'Profile settings are not available yet') +} diff --git a/src/routes/profile/media/+page.ts b/src/routes/profile/media/+page.ts index 415e8aac..9adf1131 100644 --- a/src/routes/profile/media/+page.ts +++ b/src/routes/profile/media/+page.ts @@ -1,16 +1,14 @@ -import { client } from '$lib/api/client.svelte' -import { profile } from '$lib/app/auth.svelte' -import { ReactiveState } from '$lib/app/util.svelte' - -export async function load({ fetch, url }) { - const { jwt } = profile.current - - const page = Number(url.searchParams.get('page')) || 1 - - const res = await client({ func: fetch, auth: jwt }).listMedia({ - limit: 20, - page: page, - }) - - return { images: new ReactiveState(res.images) } +import type { ListMediaResponse } from '$lib/api/types' +import type { ReactiveState } from '$lib/app/util.svelte' +import { error } from '@sveltejs/kit' + +// TODO(coves-migration): This page is unmigrated Lemmy code — it called the +// legacy pictrs listMedia endpoint, which the Coves backend 404s, crashing +// the page with a leaked backend error. The Coves API has no media-listing +// endpoint yet; remove this gate and migrate the page once one exists. The +// declared return type keeps the (currently unreachable) page type-checking. +export function load(): { + images: ReactiveState +} { + error(404, 'Media uploads are not available yet') } diff --git a/src/routes/profile/voted/[type]/+page.ts b/src/routes/profile/voted/[type]/+page.ts index 62702347..516350a2 100644 --- a/src/routes/profile/voted/[type]/+page.ts +++ b/src/routes/profile/voted/[type]/+page.ts @@ -1,46 +1,10 @@ -// eslint-disable-next-line @typescript-eslint/ban-ts-comment -// @ts-nocheck TODO(coves-migration): Needs Coves vote history API -import { client } from '$lib/api/client.svelte' -import { ReactiveState } from '$lib/app/util.svelte' -import { getItemPublished } from '$lib/feature/legacy/item.svelte' import { error } from '@sveltejs/kit' -export async function load({ url, params }) { - if (params.type.toLowerCase() != 'up' && params.type.toLowerCase() != 'down') - error(404) - - const page = Number(url.searchParams.get('page')) || 1 - - const upvoted = params.type == 'up' - - const data = await Promise.all([ - client().getPosts({ - liked_only: upvoted, - disliked_only: !upvoted, - page: page, - sort: 'New', - type_: 'All', - limit: 20, - }), - client().getComments({ - liked_only: upvoted, - disliked_only: !upvoted, - page: page, - sort: 'New', - type_: 'All', - limit: 20, - }), - ]) - - const everything = [...data[0].posts, ...data[1].comments].sort( - (a, b) => Date.parse(getItemPublished(b)) - Date.parse(getItemPublished(a)), - ) - - return { - items: everything, - upvoted: upvoted, - filters: new ReactiveState({ - page: page, - }), - } +// TODO(coves-migration): This page is unmigrated Lemmy code — it called the +// legacy /api/v3/post/list and /api/v3/comment/list endpoints, which the +// Coves backend 404s, crashing the page with a leaked backend error. The +// Coves API has no vote-history endpoint yet; remove this gate and migrate +// the page once one exists. +export function load(): never { + error(404, 'Vote history is not available yet') }