peternovak
Explore posts from serversCall multiple TRPC endpoints from onSuccess()?
The polygon that I am sending from my frontend is about 300kb, so if I batch these endpoints together I am hitting the cap of 1MB max limit of TRPC (and I didn't manage to figure out how to increase it)
11 replies
Usage of useQuery after pageload?
Could it be that TRPC does not pick up the disabled setting like in this post?
https://stackoverflow.com/questions/73940139/trpc-doesnt-react-to-config-variables-passed-e-g-enabled-false
17 replies
Usage of useQuery after pageload?
import type { NextPage } from "next";
import Image from "next/image";
import { useSession } from "next-auth/react";
import { useRouter } from "next/router";
import { api } from "@/utils/api";
import { LoadingSpinner } from "@/components/loading";
const EvaluationPage: NextPage = () => {
const { data: session } = useSession();
const router = useRouter();
const { id } = router.query;
if (!id || Array.isArray(id)) return <LoadingSpinner />;
const { data } = api.image.getEvaluation.useQuery(
{
id,
},
{
enabled: false,
}
);
return (
<>
<main className="flex min-h-screen flex-col items-center justify-center bg-gradient-to-br from-blue-400 to-indigo-800">
{session ? (
<div className="container flex flex-col items-center justify-center gap-12 px-4 py-12 ">
<h1 className="font-base text-3xl tracking-tight text-gray-100 sm:text-3xl">
Image evaluation
</h1>
<>{data && <p className="text-white">{data.response}</p>}</>
</div>
) : (
<div className="flex flex-col items-center justify-center gap-4 py-4">
<h3 className="text-center text-2xl text-gray-100">
Please sign in to continue.
</h3>
</div>
)}
</main>
</>
);
};
17 replies