Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

move closing dialog inside try

ameer2468a2b39307c206
diff --git a/apps/desktop/src/routes/editor/ExportDialog.tsx b/apps/desktop/src/routes/editor/ExportDialog.tsx
index 325dd4739..3106038d5 100644
--- a/apps/desktop/src/routes/editor/ExportDialog.tsx
+++ b/apps/desktop/src/routes/editor/ExportDialog.tsx
@@ -263,6 +263,10 @@ const ExportDialog = () => {
await commands.copyFileToPath(videoPath, path);
setExportState({ type: "saving", done: true });
+ //needs to be here so if the user cancels file selection the dialog does not close
+ setTimeout(() => {
+ setDialog((d) => ({ ...d, open: false }));
+ }, 1000);
} catch (error) {
throw error;
}
@@ -270,7 +274,6 @@ const ExportDialog = () => {
onSettled() {
setTimeout(() => {
exportWithSettings.reset();
- setDialog((d) => ({ ...d, open: false }));
setExportProgress(null);
}, 1000);
setTimeout(() => {