Skip to content

Commit e470b08

Browse files
fix hasPassword boolean logic
1 parent a4a9185 commit e470b08

File tree

5 files changed

+6
-9
lines changed

5 files changed

+6
-9
lines changed

apps/web/app/(org)/dashboard/caps/components/CapCard/CapCard.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -363,11 +363,8 @@ export const CapCard = ({
363363
</DropdownMenuItem>
364364
<DropdownMenuItem
365365
onClick={() => {
366-
if (!isSubscribed) {
367-
setUpgradeModalOpen(true);
368-
} else {
369-
setIsPasswordDialogOpen(true);
370-
}
366+
if (!isSubscribed) setUpgradeModalOpen(true);
367+
else setIsPasswordDialogOpen(true);
371368
}}
372369
className="flex gap-2 items-center rounded-lg"
373370
>

apps/web/app/(org)/dashboard/caps/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ export default async function CapsPage({
173173
${videos.createdAt}
174174
)
175175
`,
176-
hasPassword: sql`${videos.password} IS NULL`.mapWith(Boolean),
176+
hasPassword: sql`${videos.password} IS NOT NULL`.mapWith(Boolean),
177177
hasActiveUpload: sql`${videoUploads.videoId} IS NOT NULL`.mapWith(
178178
Boolean,
179179
),

apps/web/app/embed/[videoId]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ export default async function EmbedVideoPage(props: Props) {
147147
height: videos.height,
148148
duration: videos.duration,
149149
fps: videos.fps,
150-
hasPassword: sql`${videos.password} IS NULL`.mapWith(Boolean),
150+
hasPassword: sql`${videos.password} IS NOT NULL`.mapWith(Boolean),
151151
sharedOrganization: {
152152
organizationId: sharedVideos.organizationId,
153153
},

apps/web/app/s/[videoId]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ export default async function ShareVideoPage(props: Props) {
286286
height: videos.height,
287287
duration: videos.duration,
288288
fps: videos.fps,
289-
hasPassword: sql`${videos.password} IS NULL`.mapWith(Boolean),
289+
hasPassword: sql`${videos.password} IS NOT NULL`.mapWith(Boolean),
290290
sharedOrganization: {
291291
organizationId: sharedVideos.organizationId,
292292
},

apps/web/lib/folder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ export async function getVideosByFolderId(folderId: string) {
176176
${videos.createdAt}
177177
)
178178
`,
179-
hasPassword: sql`${videos.password} IS NULL`.mapWith(Boolean),
179+
hasPassword: sql`${videos.password} IS NOT NULL`.mapWith(Boolean),
180180
hasActiveUpload: sql`${videoUploads.videoId} IS NOT NULL`.mapWith(
181181
Boolean,
182182
),

0 commit comments

Comments
 (0)