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

grain.social/grain

photography-focused photo sharing platform

grain.social
1 collaborator
0
2
13 lines · 579 B Raw History
import { browser } from "$app/environment";
import { galleryFavoritesQuery } from "$lib/queries";
import type { PageLoad } from "./$types";

export const load: PageLoad = async ({ params, parent, fetch }) => {
  const actor = decodeURIComponent(params.actor);
  const rkey = params.rkey;
  const galleryUri = `at://${actor}/social.grain.gallery/${rkey}`;
  const { queryClient, viewer } = await parent();
  const prefetch = queryClient.prefetchQuery(galleryFavoritesQuery(galleryUri, viewer?.did, fetch));
  if (!browser) await prefetch;
  return { actor, rkey, galleryUri };
};