Open source Loom alternative. Beautiful, shareable screen recordings.
Rust appcapcossloommacnextjsnextjs15open-sourceossreactrecordrustscreen-capturescreen-recorderscreenshotsolidjstauritauri-apptypescriptvite
Fix export dialog upload state
ameer2468388372592d37
diff --git a/apps/desktop/src/routes/editor/ExportDialog.tsx b/apps/desktop/src/routes/editor/ExportDialog.tsxindex 3106038d5..5ee880aca 100644--- a/apps/desktop/src/routes/editor/ExportDialog.tsx+++ b/apps/desktop/src/routes/editor/ExportDialog.tsx@@ -100,7 +100,6 @@ const ExportDialog = () => {const [compression, setCompression] = createSignal(localStorage.getItem("cap-export-compression") || "social");- const [uploadComplete, setUploadComplete] = createSignal(false);createEffect(() => {localStorage.setItem("cap-export-format", format());@@ -284,7 +283,7 @@ const ExportDialog = () => {const uploadVideo = createMutation(() => ({mutationFn: async () => {- setUploadState({ type: "idle" });+ setUploadState({ type: "starting" });console.log("Starting upload process...");@@ -335,8 +334,6 @@ const ExportDialog = () => {});try {- setUploadState({ type: "starting" });-// Setup progress listener before starting uploadconsole.log("Starting actual upload...");@@ -404,7 +401,7 @@ const ExportDialog = () => {},onSuccess: () => {metaActions.refetch();- setUploadComplete(true);+ setUploadState({ type: "complete" });metaUpdateStore.notifyUpdate(videoId);},onError: (error) => {@@ -413,9 +410,7 @@ const ExportDialog = () => {);},onSettled() {- setTimeout(() => {- uploadVideo.reset();- }, 2000);+ uploadVideo.reset();setExportProgress(null);},}));@@ -684,7 +679,7 @@ const ExportDialog = () => {<DialogContenttitle={"Export"}confirm={- <Show when={uploadComplete()}>+ <Show when={uploadState.type === "complete"}><div class="relative"><ahref={recordingMeta()?.sharing?.link}@@ -729,10 +724,9 @@ const ExportDialog = () => {</Show>}close={- <Show when={uploadComplete()}>+ <Show when={uploadState.type === "complete"}><ButtononClick={() => {- setUploadComplete(false);setUploadState({ type: "idle" });}}variant="secondary"@@ -746,7 +740,7 @@ const ExportDialog = () => {><div class="relative z-10 px-5 py-4 mx-auto space-y-6 w-full text-center">{/** Upload success */}- <Show when={uploadComplete()}>+ <Show when={uploadState.type === "complete"}><UploadingSuccessContent /></Show>{/** Copying to clipboard */}@@ -757,7 +751,9 @@ const ExportDialog = () => {<Showwhen={uploadState.type !== "idle" &&- (uploadVideo.isPending || uploadState.type === "starting")+ (uploadVideo.isPending ||+ uploadState.type === "starting" ||+ uploadState.type === "rendering")}><UploadingCapContent />diff --git a/apps/desktop/src/routes/editor/context.ts b/apps/desktop/src/routes/editor/context.tsindex 850af21c3..5b3f8498f 100644--- a/apps/desktop/src/routes/editor/context.ts+++ b/apps/desktop/src/routes/editor/context.ts@@ -119,6 +119,7 @@ export const [EditorContextProvider, useEditorContext] = createContextProvider(| { type: "rendering" }| { type: "uploading"; progress: number }| { type: "link-copied" }+ | { type: "complete" }>({ type: "idle" });//This is used in ShareButton.tsx to notify the component that the metadata has changed, from ExportDialog.tsx