~ knotless Search/
↑↓ move↵ open⇧↵ all results

johnandersen777.bsky.social/knotless

git that lives in your Atmosphere account

Forked from chadtmiller.com/knotless

0
0
22 lines · 843 B Raw History
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<typeof listNotifications.main>(
		event,
		'dev.knotless.listNotifications',
		{ cursor, kind },
		true
	);
	return { page, login: true, kind: kind ?? null };
};