Upgrade Next.js to 16.4.6 and show locks on latest videos
Deploy Vault CMS / deploy (push) Failing after 4m1s
Deploy Vault CMS / deploy (push) Failing after 4m1s
- Upgrade next and eslint-config-next from 16.3.5 to 16.4.6. The older version has critical advisories, which made the Docker build's `pnpm audit --audit-level critical` step fail and blocked deploys. - /api/videos/latest now reports whether the viewer can open each video; the dashboard shows a lock and the reason instead of opening the player. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
@@ -25,6 +25,7 @@ import { SiteHeader } from '@/components/site-header';
|
||||
import { SidebarInset, SidebarProvider } from '@/components/ui/sidebar';
|
||||
import { Lock } from 'lucide-react';
|
||||
import Image from 'next/image';
|
||||
import { toast } from 'sonner';
|
||||
|
||||
type VideoItem = {
|
||||
id: string;
|
||||
@@ -248,6 +249,10 @@ export default function DashboardClient() {
|
||||
<Card
|
||||
className="@container/card overflow-hidden cursor-pointer"
|
||||
onClick={() => {
|
||||
if (v.accessible === false) {
|
||||
toast.error(v.lockReason ?? 'This video is locked.');
|
||||
return;
|
||||
}
|
||||
if (v.playlist?.id) {
|
||||
handleOpenVideo(v.playlist.id, v.id);
|
||||
}
|
||||
@@ -261,6 +266,11 @@ export default function DashboardClient() {
|
||||
className="w-full h-full object-cover"
|
||||
loading="lazy"
|
||||
/>
|
||||
{v.accessible === false ? (
|
||||
<div className="absolute inset-0 bg-black/40 flex items-center justify-center">
|
||||
<Lock className="w-5 h-5 text-white" />
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
<div className="flex gap-2 items-start pt-2">
|
||||
{v.uploader?.image && (
|
||||
|
||||
Reference in New Issue
Block a user