From 9babaa507070b992214b0bcee0f524b20f761b09 Mon Sep 17 00:00:00 2001 From: ameer2468 <33054370+ameer2468@users.noreply.github.com> Date: Thu, 23 Oct 2025 00:20:51 +0300 Subject: [PATCH 1/4] improve check --- apps/web/app/s/[videoId]/Share.tsx | 3 +++ apps/web/app/s/[videoId]/_components/Sidebar.tsx | 7 +++---- apps/web/app/s/[videoId]/_components/tabs/Summary.tsx | 2 +- apps/web/app/s/[videoId]/page.tsx | 1 + 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/apps/web/app/s/[videoId]/Share.tsx b/apps/web/app/s/[videoId]/Share.tsx index ef7d9a270c..fdc0c8bc35 100644 --- a/apps/web/app/s/[videoId]/Share.tsx +++ b/apps/web/app/s/[videoId]/Share.tsx @@ -51,6 +51,7 @@ interface ShareProps { customDomain: string | null; domainVerified: boolean; videoSettings?: OrganizationSettings | null; + ownerIsPro: boolean; userOrganizations?: { id: string; name: string }[]; initialAiData?: { title?: string | null; @@ -141,6 +142,7 @@ export const Share = ({ data, user, comments, + ownerIsPro, views, initialAiData, aiGenerationEnabled, @@ -321,6 +323,7 @@ export const Share = ({ createdAt: effectiveDate, transcriptionStatus, }} + ownerIsPro={ownerIsPro} videoSettings={videoSettings} user={user} commentsData={commentsData} diff --git a/apps/web/app/s/[videoId]/_components/Sidebar.tsx b/apps/web/app/s/[videoId]/_components/Sidebar.tsx index 2f92fd8875..484100b62b 100644 --- a/apps/web/app/s/[videoId]/_components/Sidebar.tsx +++ b/apps/web/app/s/[videoId]/_components/Sidebar.tsx @@ -43,6 +43,7 @@ interface SidebarProps { processing?: boolean; } | null; aiGenerationEnabled?: boolean; + ownerIsPro: boolean; } const TabContent = motion.div; @@ -85,6 +86,7 @@ export const Sidebar = forwardRef<{ scrollToBottom: () => void }, SidebarProps>( videoId, aiData, aiGenerationEnabled = false, + ownerIsPro, }, ref, ) => { @@ -141,9 +143,6 @@ export const Sidebar = forwardRef<{ scrollToBottom: () => void }, SidebarProps>( setActiveTab(tabId); }; - const isOwner = user?.id === data.ownerId; - const isVideoOwnerPro = user && isOwner ? userIsPro(user) : false; - const renderTabContent = () => { switch (activeTab) { case "activity": @@ -184,7 +183,7 @@ export const Sidebar = forwardRef<{ scrollToBottom: () => void }, SidebarProps>( isSummaryDisabled={videoSettings?.disableSummary} initialAiData={aiData || undefined} aiGenerationEnabled={aiGenerationEnabled} - isVideoOwnerPro={isVideoOwnerPro} + isVideoOwnerPro={ownerIsPro} /> ); case "transcript": diff --git a/apps/web/app/s/[videoId]/_components/tabs/Summary.tsx b/apps/web/app/s/[videoId]/_components/tabs/Summary.tsx index 1a3d17488d..6e3d17ef0c 100644 --- a/apps/web/app/s/[videoId]/_components/tabs/Summary.tsx +++ b/apps/web/app/s/[videoId]/_components/tabs/Summary.tsx @@ -22,7 +22,7 @@ interface SummaryProps { }; aiGenerationEnabled?: boolean; isSummaryDisabled?: boolean; - isVideoOwnerPro: boolean | null; + isVideoOwnerPro: boolean; } const formatTime = (time: number) => { diff --git a/apps/web/app/s/[videoId]/page.tsx b/apps/web/app/s/[videoId]/page.tsx index b34286685e..54052d8743 100644 --- a/apps/web/app/s/[videoId]/page.tsx +++ b/apps/web/app/s/[videoId]/page.tsx @@ -697,6 +697,7 @@ async function AuthorizedContent({ organizationMembers: membersList.map((member) => member.userId), organizationId: video.sharedOrganization?.organizationId ?? undefined, sharedOrganizations: sharedOrganizations, + ownerIsPro: video.ownerIsPro ?? false, password: null, folderId: null, orgSettings: video.orgSettings || null, From d0b33e09661a65d56ef79c580aa00d78732949d7 Mon Sep 17 00:00:00 2001 From: ameer2468 <33054370+ameer2468@users.noreply.github.com> Date: Thu, 23 Oct 2025 00:23:35 +0300 Subject: [PATCH 2/4] naming --- apps/web/app/s/[videoId]/Share.tsx | 3 +-- apps/web/app/s/[videoId]/_components/Sidebar.tsx | 4 ++-- apps/web/app/s/[videoId]/_components/tabs/Summary.tsx | 4 ++-- apps/web/app/s/[videoId]/page.tsx | 1 + 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/web/app/s/[videoId]/Share.tsx b/apps/web/app/s/[videoId]/Share.tsx index fdc0c8bc35..2d3cae7d9e 100644 --- a/apps/web/app/s/[videoId]/Share.tsx +++ b/apps/web/app/s/[videoId]/Share.tsx @@ -39,7 +39,6 @@ type VideoWithOrganizationInfo = typeof videos.$inferSelect & { organizationId?: string; sharedOrganizations?: { id: string; name: string }[]; hasPassword?: boolean; - ownerIsPro?: boolean; orgSettings?: OrganizationSettings | null; }; @@ -51,7 +50,7 @@ interface ShareProps { customDomain: string | null; domainVerified: boolean; videoSettings?: OrganizationSettings | null; - ownerIsPro: boolean; + ownerIsPro?: boolean; userOrganizations?: { id: string; name: string }[]; initialAiData?: { title?: string | null; diff --git a/apps/web/app/s/[videoId]/_components/Sidebar.tsx b/apps/web/app/s/[videoId]/_components/Sidebar.tsx index 484100b62b..137977050e 100644 --- a/apps/web/app/s/[videoId]/_components/Sidebar.tsx +++ b/apps/web/app/s/[videoId]/_components/Sidebar.tsx @@ -43,7 +43,7 @@ interface SidebarProps { processing?: boolean; } | null; aiGenerationEnabled?: boolean; - ownerIsPro: boolean; + ownerIsPro?: boolean; } const TabContent = motion.div; @@ -183,7 +183,7 @@ export const Sidebar = forwardRef<{ scrollToBottom: () => void }, SidebarProps>( isSummaryDisabled={videoSettings?.disableSummary} initialAiData={aiData || undefined} aiGenerationEnabled={aiGenerationEnabled} - isVideoOwnerPro={ownerIsPro} + ownerIsPro={ownerIsPro} /> ); case "transcript": diff --git a/apps/web/app/s/[videoId]/_components/tabs/Summary.tsx b/apps/web/app/s/[videoId]/_components/tabs/Summary.tsx index 6e3d17ef0c..2255470a09 100644 --- a/apps/web/app/s/[videoId]/_components/tabs/Summary.tsx +++ b/apps/web/app/s/[videoId]/_components/tabs/Summary.tsx @@ -22,7 +22,7 @@ interface SummaryProps { }; aiGenerationEnabled?: boolean; isSummaryDisabled?: boolean; - isVideoOwnerPro: boolean; + ownerIsPro?: boolean; } const formatTime = (time: number) => { @@ -66,7 +66,7 @@ export const Summary: React.FC = ({ initialAiData, isSummaryDisabled = false, aiGenerationEnabled = false, - isVideoOwnerPro, + ownerIsPro, }) => { const [aiData, setAiData] = useState<{ title?: string | null; diff --git a/apps/web/app/s/[videoId]/page.tsx b/apps/web/app/s/[videoId]/page.tsx index 54052d8743..7fe1947d66 100644 --- a/apps/web/app/s/[videoId]/page.tsx +++ b/apps/web/app/s/[videoId]/page.tsx @@ -729,6 +729,7 @@ async function AuthorizedContent({ data={videoWithOrganizationInfo} videoSettings={videoWithOrganizationInfo.settings} user={user} + ownerIsPro={videoWithOrganizationInfo.ownerIsPro} comments={commentsPromise} views={viewsPromise} customDomain={customDomain} From 5cea4c71df55e6af87fe2f19ce8134e9866244a7 Mon Sep 17 00:00:00 2001 From: ameer2468 <33054370+ameer2468@users.noreply.github.com> Date: Thu, 23 Oct 2025 00:28:44 +0300 Subject: [PATCH 3/4] Update Summary.tsx --- apps/web/app/s/[videoId]/_components/tabs/Summary.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/app/s/[videoId]/_components/tabs/Summary.tsx b/apps/web/app/s/[videoId]/_components/tabs/Summary.tsx index 2255470a09..4725afe51d 100644 --- a/apps/web/app/s/[videoId]/_components/tabs/Summary.tsx +++ b/apps/web/app/s/[videoId]/_components/tabs/Summary.tsx @@ -94,7 +94,7 @@ export const Summary: React.FC = ({ } }; - if (!isVideoOwnerPro) { + if (!ownerIsPro) { return (
From f4d2fab02ffdaf35141c22c6492ecebf8a574102 Mon Sep 17 00:00:00 2001 From: ameer2468 <33054370+ameer2468@users.noreply.github.com> Date: Thu, 23 Oct 2025 00:41:41 +0300 Subject: [PATCH 4/4] Update ShareHeader.tsx --- apps/web/app/s/[videoId]/_components/ShareHeader.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/app/s/[videoId]/_components/ShareHeader.tsx b/apps/web/app/s/[videoId]/_components/ShareHeader.tsx index a80df1fa8f..9ea8d9cc05 100644 --- a/apps/web/app/s/[videoId]/_components/ShareHeader.tsx +++ b/apps/web/app/s/[videoId]/_components/ShareHeader.tsx @@ -183,7 +183,7 @@ export const ShareHeader = ({ return ( <> - {user !== null && !isVideoOwnerPro && ( + {isOwner && !isVideoOwnerPro && (

Shareable links are limited to 5 mins on the free plan.