add recording not shared message

This commit is contained in:
MarconLP 2023-04-12 16:02:43 +02:00
parent 7733173006
commit 02160a2af8
No known key found for this signature in database
GPG key ID: F4CAFFDFA3451D5E
2 changed files with 15 additions and 4 deletions

View file

@ -10,7 +10,7 @@ const VideoList: NextPage = () => {
const router = useRouter(); const router = useRouter();
const { videoId } = router.query as { videoId: string }; const { videoId } = router.query as { videoId: string };
const { data: video, isError } = api.video.get.useQuery( const { data: video } = api.video.get.useQuery(
{ videoId }, { videoId },
{ {
enabled: router.isReady, enabled: router.isReady,
@ -18,8 +18,17 @@ const VideoList: NextPage = () => {
} }
); );
if (isError) { if (!video?.success) {
return <span>this video is not publicly available</span>; return (
<div className="flex h-screen w-screen flex-col items-center justify-center">
<span className="max-w-[80%] text-center text-2xl font-medium">
This recording is currently unavailable
</span>
<span className="mt-3 max-w-[80%] text-center text-sm">
To create your own public recordings, create an account for free!
</span>
</div>
);
} }
return ( return (

View file

@ -27,7 +27,9 @@ export const videoRouter = createTRPCRouter({
}); });
if (video?.userId !== ctx.session.user.id) { if (video?.userId !== ctx.session.user.id) {
throw new TRPCError({ code: "UNAUTHORIZED" }); return {
success: false,
};
} }
const getObjectCommand = new GetObjectCommand({ const getObjectCommand = new GetObjectCommand({