import type * as listNotifications from '#lib/lexicons/dev/knotless/listNotifications.ts'; import type { PageLoad } from './$types'; import { xrpc } from '#lib/data.ts'; /** * What others did that concerns whoever is logged in, a page at a time, * of one kind when `kind` says: * none for anyone else, or from a server that keeps no index. */ export const load: PageLoad = async (event) => { const { viewer } = await event.parent(); if (!viewer?.actor) return { page: null, login: viewer?.login ?? false, kind: null }; const cursor = event.url.searchParams.get('cursor') ?? undefined; const kind = event.url.searchParams.get('kind') || undefined; const page = await xrpc( event, 'dev.knotless.listNotifications', { cursor, kind }, true ); return { page, login: true, kind: kind ?? null }; };