Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

feat(web): add share page support for edit upload state

Richie McIlroyd8c0c6872190
diff --git a/apps/web/app/s/[videoId]/page.tsx b/apps/web/app/s/[videoId]/page.tsx
index e150162fb..53e7b1013 100644
--- a/apps/web/app/s/[videoId]/page.tsx
+++ b/apps/web/app/s/[videoId]/page.tsx
@@ -48,6 +48,7 @@ import {
SOCIAL_REFERRER_DOMAINS,
} from "@/lib/social-crawlers";
import { transcribeVideo } from "@/lib/transcribe";
+import { reconcileStaleEditUpload } from "@/lib/video-edit-processing";
import { optionFromTOrFirst } from "@/utils/effect";
import { isAiGenerationEnabled } from "@/utils/flags";
import { PasswordOverlay } from "./_components/PasswordOverlay";
@@ -327,6 +328,8 @@ export default async function ShareVideoPage(props: PageProps<"/s/[videoId]">) {
const searchParams = await props.searchParams;
const videoId = params.videoId as Video.VideoId;
+ await reconcileStaleEditUpload(videoId);
+
return Effect.gen(function* () {
const videosPolicy = yield* VideosPolicy;
@@ -368,6 +371,7 @@ export default async function ShareVideoPage(props: PageProps<"/s/[videoId]">) {
hasActiveUpload: sql`${videoUploads.videoId} IS NOT NULL`.mapWith(
Boolean,
),
+ activeUploadRawFileKey: videoUploads.rawFileKey,
owner: users,
})
.from(videos)
@@ -411,6 +415,7 @@ async function AuthorizedContent({
sharedOrganization: { organizationId: Organisation.OrganisationId } | null;
hasPassword: boolean;
hasActiveUpload: boolean;
+ activeUploadRawFileKey: string | null;
orgSettings?: OrganizationSettings | null;
videoSettings?: OrganizationSettings | null;
};
diff --git a/apps/web/app/s/[videoId]/types.ts b/apps/web/app/s/[videoId]/types.ts
index bd6bf8778..ad855abc7 100644
--- a/apps/web/app/s/[videoId]/types.ts
+++ b/apps/web/app/s/[videoId]/types.ts
@@ -13,6 +13,8 @@ export type VideoData = Omit<typeof videos.$inferSelect, "ownerId"> & {
inheritedPasswordSources?: SpaceRuleSource[];
inheritedSpaceSettings?: Partial<Record<ViewerSettingKey, SpaceRuleSource[]>>;
orgSettings?: OrganizationSettings | null;
+ hasActiveUpload?: boolean;
+ activeUploadRawFileKey?: string | null;
};
export type VideoOwner = {