add recording not shared message
This commit is contained in:
parent
7733173006
commit
02160a2af8
2 changed files with 15 additions and 4 deletions
|
|
@ -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 (
|
||||||
|
|
|
||||||
|
|
@ -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({
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue